Found 238306 results in 37611 files, showing top 50 files (show more).
github.com/html5rocks/www.html5rocks.com:static/demos/lemdoodle/examples/lem-planes/combined.js: [ master, ]
5051:   'needle': ['intro-finale/items-needle-thread', 'intro-finale/items-needle'],
5086:   'thread': ['intro-finale/items-thread', 'intro-finale/items-thread'],
5084:   'thread-thimble': ['intro-finale/items-thread-thimble',
5085:                      'intro-finale/items-thread-thimble'],
5102:     'needle', 'halo', 'noodles', 'neutron', 'nose'
5105:     'thread', 'pinstripe', 'neutron', 'noodles', 'clove'
5125:     'thread', 'thimble', 'earmuffs', 'neutron', 'nose'
5131:     'thread', 'thimble', 'noodles', 'neutron', 'nose', 'gnocchi', 'rivet',
13797:     'intro-finale/items-needle-thread',
13798:     'intro-finale/items-needle',
13839:     'intro-finale/items-thread-thimble',
13840:     'intro-finale/items-thread',
15100:   'intro-finale/items-needle-thread': { width: 68, height: 65, x: 834, y: 0 },
15101:   'intro-finale/items-needle': { top: 8, width: 59, height: 51, x: 904, y: 0 },
15142:   'intro-finale/items-thread-thimble': { left: 2, top: 11, bottom: 14, right: 11, width: 52, height: 40, x: 690, y: 96 },
15143:   'intro-finale/items-thread': { left: 4, top: 16, bottom: 15, right: 13, width: 48, height: 34, x: 744, y: 96 },
github.com/html5rocks/www.html5rocks.com:static/demos/lemdoodle/examples/lem-embedded/combined.js: [ master, ]
5024:   'needle': ['intro-finale/items-needle-thread', 'intro-finale/items-needle'],
5059:   'thread': ['intro-finale/items-thread', 'intro-finale/items-thread'],
5057:   'thread-thimble': ['intro-finale/items-thread-thimble',
5058:                      'intro-finale/items-thread-thimble'],
5075:     'needle', 'halo', 'noodles', 'neutron', 'nose'
5078:     'thread', 'pinstripe', 'neutron', 'noodles', 'clove'
5098:     'thread', 'thimble', 'earmuffs', 'neutron', 'nose'
5104:     'thread', 'thimble', 'noodles', 'neutron', 'nose', 'gnocchi', 'rivet',
13827:               // First run: Thread + thimble
13828:               nItems = ['thread', 'thimble'];
13831:               // Second run: Thread/thimble + random item that’s neither
13832:               nItems[0] = 'thread-thimble';
13836:               } while ((nItems[1] == 'thread-thimble') ||
13837:                        (nItems[1] == 'thread') || (nItems[1] == 'thimble'));
13843:             nItems = ['needle', 'noodles'];
13849:               nItems = ['thread', 'thimble'];
13852:               nItems = ['thread-thimble', 'forget-me-not'];
13859:               nItems = ['thread', 'thimble'];
13862:               nItems = ['thread-thimble', 'scissors'];
13868:             nItems = ['thread', 'pinstripe'];
13884:               nItems = ['thread', 'thimble'];
13887:               nItems = ['thread-thimble', 'neutron'];
13894:               nItems = ['thread', 'thimble'];
13897:               nItems = ['thread-thimble', 'basket'];
15362:     'intro-finale/items-needle-thread',
15363:     'intro-finale/items-needle',
15404:     'intro-finale/items-thread-thimble',
15405:     'intro-finale/items-thread',
16665:   'intro-finale/items-needle-thread': { width: 68, height: 65, x: 834, y: 0 },
16666:   'intro-finale/items-needle': { top: 8, width: 59, height: 51, x: 904, y: 0 },
16707:   'intro-finale/items-thread-thimble': { left: 2, top: 11, bottom: 14, right: 11, width: 52, height: 40, x: 690, y: 96 },
16708:   'intro-finale/items-thread': { left: 4, top: 16, bottom: 15, right: 13, width: 48, height: 34, x: 744, y: 96 },
github.com/chromium/chromium:native_client_sdk/src/libraries/third_party/pthreads-win32/implement.h: [ master, ]
185:   DWORD thread;			/* Win32 thread ID */
502:   ptw32_thread_t * thread;
158:   HANDLE threadH;		/* Win32 thread handle - POSIX thread is invalid if threadH == 0 */
162:   ptw32_mcs_lock_t threadLock;	/* Used for serialised access to public thread state */
246:   pthread_t ownerThread;
346:   void *threads;
350: typedef struct ThreadParms ThreadParms;
352: struct ThreadParms
401: typedef struct ThreadKeyAssoc ThreadKeyAssoc;
403: struct ThreadKeyAssoc
505:   ThreadKeyAssoc *nextThread;
507:   ThreadKeyAssoc *prevThread;
152: typedef struct ptw32_thread_t_       ptw32_thread_t;
155: struct ptw32_thread_t_
575: #define PTW32_THREAD_REUSE_EMPTY ((ptw32_thread_t *)(size_t) 1)
198: struct pthread_attr_t_
234: struct pthread_mutex_t_
273: struct pthread_mutexattr_t_
302: struct pthread_spinlock_t_
326: struct pthread_barrier_t_
336: struct pthread_barrierattr_t_
341: struct pthread_key_t_
360: struct pthread_cond_t_
378: struct pthread_condattr_t_
385: struct pthread_rwlock_t_
396: struct pthread_rwlockattr_t_
133:   PThreadStateInitial = 0,	/* Thread not running                   */
134:   PThreadStateRunning,		/* Thread alive & kicking               */
135:   PThreadStateSuspended,	/* Thread alive but suspended           */
136:   PThreadStateCancelPending,	/* Thread alive but                     */
138:   PThreadStateCanceling,	/* Thread alive but is                  */
141:   PThreadStateExiting,		/* Thread alive but exiting             */
143:   PThreadStateLast,             /* All handlers have been run and now   */
145:   PThreadStateReuse             /* In reuse pool.                       */
147: PThreadState;
944: #define _beginthreadex(security, \
957: #define _endthreadex ExitThread
129:    * This enumeration represents the state of the thread;
130:    * The thread is still "alive" if the numeric value of the
157:   unsigned __int64 seqNumber;	/* Process-unique thread sequence number */
159:   pthread_t ptHandle;		/* This thread's permanent pthread_t handle */
160:   ptw32_thread_t * prevReuse;	/* Links threads on reuse stack */
242:   int recursive_count;		/* Number of unlocks a thread needs to perform
263:  * Node used to manage per-thread lists of currently-held robust mutexes.
407:    *      This structure creates an association between a thread and a key.
409:    *      destroy routine for thread specific data registered by a user upon
410:    *      exiting a thread.
416:    *         T - Thread that has called pthread_setspecific(Kn)
417:    *            (head of chain is thread->keys)
436:    *      general lock (guarding the row) and the thread's general
440:    *      until both the key is deleted and the thread has called the
442:    *      to be freed as soon as either thread or key is concluded.
445:    *      key and thread locks are acquired consistently in the order
446:    *      "key lock then thread lock". An exception to this exists
447:    *      when a thread calls the destructors, however, this is done
450:    *      An association is created when a thread first calls
455:    *      thread calls the key destructor function on thread exit, or
459:    *      thread
460:    *              reference to the thread that owns the
462:    *              thread struct itself. Since the association is
463:    *              destroyed before the thread exits, this can never
464:    *              point to a different logical thread to the one that
465:    *              created the assoc, i.e. after thread struct reuse.
492:    *      1)      As soon as either the key or the thread is no longer
574: /* Thread Reuse stack bottom marker. Must not be NULL or any valid pointer to memory. */
578: extern ptw32_thread_t * ptw32_threadReuseTop;
579: extern ptw32_thread_t * ptw32_threadReuseBottom;
593: extern ptw32_mcs_lock_t ptw32_thread_reuse_lock;
626:   void ptw32_robust_mutex_remove(pthread_mutex_t* mutex, ptw32_thread_t* otp);
644:   void ptw32_threadReusePush (pthread_t thread);
648:   int ptw32_setthreadpriority (pthread_t thread, int policy, int priority);
659:   void ptw32_callUserDestroyRoutines (pthread_t thread);
661:   int ptw32_tkAssocCreate (ptw32_thread_t * thread, pthread_key_t key);
6:  * Keeps all the internals out of pthread.h
10:  *      Pthreads-win32 - POSIX Threads Library for Win32
224:   pthread_mutex_t lock;
248: 				   threads. */
267:   pthread_mutex_t mx;
308:     pthread_mutex_t mutex;	/* mutex if single cpu.            */
354:   pthread_t tid;
362:   long nWaitersBlocked;		/* Number of threads blocked            */
363:   long nWaitersGone;		/* Number of threads timed out          */
364:   long nWaitersToUnblock;	/* Number of threads to unblock         */
365:   sem_t semBlockQueue;		/* Queue up threads waiting for the     */
370:   pthread_mutex_t mtxUnblockLock;	/* Mutex that guards access to          */
373:   pthread_cond_t next;		/* Doubly linked list                   */
374:   pthread_cond_t prev;
387:   pthread_mutex_t mtxExclusiveAccess;
388:   pthread_mutex_t mtxSharedAccessCompleted;
389:   pthread_cond_t cndSharedAccessCompleted;
415:    *            (head of chain is key->threads)
451:    *      pthread_setspecific() on a key that has a specified
471:    *              The pthread_t->keys attribute is the head of a
474:    *              between a pthread_t and all pthread_key_t on which
475:    *              it called pthread_setspecific.
480:    *      nextThread
481:    *              The pthread_key_t->threads attribute is the head of
484:    *              relationship between a pthread_key_t and all the 
485:    *              PThreads that have called pthread_setspecific for
486:    *              this pthread_key_t.
488:    *      prevThread
497:    *              pthread_setspecific if the user provided a
503:   pthread_key_t key;
504:   ThreadKeyAssoc *nextKey;
506:   ThreadKeyAssoc *prevKey;
571: /* Declared in pthread_cancel.c */
580: extern pthread_key_t ptw32_selfThreadKey;
581: extern pthread_key_t ptw32_cleanupKey;
582: extern pthread_cond_t ptw32_cond_list_head;
583: extern pthread_cond_t ptw32_cond_list_tail;
587: extern unsigned __int64 ptw32_threadSeqNumber;
601: extern int pthread_count;
617:   int ptw32_is_attr (const pthread_attr_t * attr);
619:   int ptw32_cond_check_need_init (pthread_cond_t * cond);
620:   int ptw32_mutex_check_need_init (pthread_mutex_t * mutex);
621:   int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock);
622:   int ptw32_spinlock_check_need_init (pthread_spinlock_t * lock);
624:   int ptw32_robust_mutex_inherit(pthread_mutex_t * mutex);
625:   void ptw32_robust_mutex_add(pthread_mutex_t* mutex, pthread_t self);
630: 			       HANDLE threadH, DWORD callback_arg);
636:   void ptw32_threadDestroy (pthread_t tid);
640:   pthread_t ptw32_new (void);
642:   pthread_t ptw32_threadReusePop (void);
657:     ptw32_threadStart (void *vthreadParms);
663:   void ptw32_tkAssocDestroy (ThreadKeyAssoc * assoc);
714:   _CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *),
716:   _CRTIMP void __cdecl _endthread (void);
937: #if defined(NEED_CREATETHREAD)
940:  * Macro uses args so we can cast start_proc to LPTHREAD_START_ROUTINE
950:         CreateThread(security, \
952:                      (LPTHREAD_START_ROUTINE) start_proc, \
959: #endif				/* NEED_CREATETHREAD */
12:  *      Copyright(C) 1999,2005 Pthreads-win32 contributors
20:  *      http://sources.redhat.com/pthreads-win32/contributors.html
131:    * state is greater or equal "PThreadStateRunning".
161:   volatile PThreadState state;
483:    *              nextThreads link. This chain provides the 1 to many
717:   _CRTIMP unsigned long __cdecl _beginthreadex (void *, unsigned,
720:   _CRTIMP void __cdecl _endthreadex (unsigned);
chromium.googlesource.com/ios-chromium-mirror:native_client_sdk/src/libraries/third_party/pthreads-win32/implement.h: [ master, ] Duplicate result
chromium.googlesource.com/chromium/src:native_client_sdk/src/libraries/third_party/pthreads-win32/implement.h: [ master, ] Duplicate result
chromium.googlesource.com/arc/arc:third_party/chromium-ppapi/native_client_sdk/src/libraries/third_party/pthreads-win32/implement.h: [ master, ] Duplicate result
github.com/google/grumpy:third_party/stdlib/threading.py: [ master, ]
631: class Thread(_Verbose):
35: _start_new_thread = thread.start_new_thread
1148: current_thread = currentThread
38: ThreadError = thread.error
1071: class _MainThread(Thread):
1096: def _pickSomeNonDaemonThread():
1111: class _DummyThread(Thread):
1135: def currentThread():
1365:     class ProducerThread(Thread):
1381:     class ConsumerThread(Thread):
1: """Thread module emulating a subset of Java's threading model."""
6:     import thread
31:            'current_thread', 'enumerate', 'Event',
32:            'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Thread',
36: _allocate_lock = thread.allocate_lock
37: _get_ident = thread.get_ident
39: del thread
67:                 # Issue #4188: calling current_thread() can incur an infinite
73:                     name = "<OS thread %d>" % ident
93:     The func will be passed to sys.setprofile() for each thread, before its
103:     The func will be passed to sys.settrace() for each thread, before its run()
117:     A reentrant lock must be released by the thread that acquired it. Once a
118:     thread has acquired a reentrant lock, the same thread may acquire it again
119:     without blocking; the thread must release it once for each time it has
126:     """A reentrant lock must be released by the thread that acquired it. Once a
127:        thread has acquired a reentrant lock, the same thread may acquire it
128:        again without blocking; the thread must release it once for each time it
150:         When invoked without arguments: if this thread already owns the lock,
152:         if another thread owns the lock, block until the lock is unlocked. Once
153:         the lock is unlocked (not owned by any thread), then grab ownership, set
154:         the recursion level to one, and return. If more than one thread is
191:         by any thread), and if any other threads are blocked waiting for the
194:         locked and owned by the calling thread.
196:         Only call this method when the calling thread owns the lock. A
246:     notified by another thread.
257:        notified by another thread.
301:         # Return True if lock is owned by current_thread.
312:         If the calling thread has not acquired the lock when this method is
317:         variable in another thread, or until the optional timeout occurs. Once
376:         If the calling thread has not acquired the lock when this method is
403:         If the calling thread has not acquired the lock when this method
445:         on entry, block, waiting until some other thread has called release() to
482:         When the counter is zero on entry and another thread is waiting for it
483:         to become larger than zero again, wake up that thread.
528:         When the counter is zero on entry and another thread is waiting for it
529:         to become larger than zero again, wake up that thread.
567:         # private!  called by Thread._reset_internal_locks by _after_fork()
601:         block until another thread calls set() to set the flag to true, or until
617: # Helper to generate new thread names
619: _counter() # Consume 0 so first non-main thread has id 1.
620: def _newname(template="Thread-%d"):
623: # Active thread administration
625: _active = {}    # maps thread id to Thread object
632:     """A class that represents a thread of control.
649:         *name* is the thread name. By default, a unique name is constructed of
650:         the form "Thread-N" where N is a small decimal number.
658:         the base class constructor (Thread.__init__()) before doing anything
659:         else to the thread.
694:         return current_thread().daemon
697:         assert self.__initialized, "Thread.__init__() was not called"
710:         """Start the thread's activity.
712:         It must be called at most once per thread object. It arranges for the
713:         object's run() method to be invoked in a separate thread of control.
716:         same thread object.
720:             raise RuntimeError("thread.__init__() not called")
724:             self._note("%s.start(): starting thread", self)
728:             _start_new_thread(self.__bootstrap, ())
736:         """Method representing the thread's activity.
748:             # Avoid a refcycle if the thread is running a function with
749:             # an argument that has a member that points to the thread.
755:         # happen when a daemon thread wakes up at an unfortunate
783:                 self._note("%s.__bootstrap(): thread started", self)
805:                     print>>_sys.stderr, ("Exception in thread %s:\n%s" %
814:                             "Exception in thread " + self.name +
860:         "Remove current thread from the dict of currently running threads."
862:         # Notes about running with dummy_thread:
864:         # Must take care to not raise an exception if dummy_thread is being
866:         # dummy_threading).  dummy_thread.get_ident() always returns -1 since
867:         # there is only one thread if dummy_thread is being used.  Thus
868:         # len(_active) is always <= 1 here, and any Thread instance created
869:         # overwrites the (if any) thread currently registered in _active.
872:         # gets overwritten the instant an instance of Thread is created; both
873:         # threads return -1 from dummy_thread.get_ident() and thus have the
876:         # it gets a KeyError if another Thread instance was created.
888:                 # could try to acquire the lock again in the same thread, (in
889:                 # current_thread()), and would block.
895:         """Wait until the thread terminates.
897:         This blocks the calling thread until the thread whose join() method is
905:         thread is still alive, the join() call timed out.
908:         block until the thread terminates.
910:         A thread can be join()ed many times.
913:         thread as that would cause a deadlock. It is also an error to join() a
914:         thread before it has been started and attempts to do so raises the same
919:             raise RuntimeError("Thread.__init__() not called")
921:             raise RuntimeError("cannot join thread before it is started")
922:         if self is current_thread():
923:             raise RuntimeError("cannot join current thread")
927:                 self._note("%s.join(): waiting until thread stops", self)
934:                     self._note("%s.join(): thread stopped", self)
946:                         self._note("%s.join(): thread stopped", self)
957:         assert self.__initialized, "Thread.__init__() not called"
961:         assert self.__initialized, "Thread.__init__() not called"
968:         """Thread identifier of this thread or None if it has not been started.
970:         This is a nonzero integer. See the thread.get_ident() function. Thread
971:         identifiers may be recycled when a thread exits and another thread is
972:         created. The identifier is available even after the thread has exited.
975:         assert self.__initialized, "Thread.__init__() not called"
979:         """Return whether the thread is alive.
986:         assert self.__initialized, "Thread.__init__() not called"
992:         """A boolean value indicating whether this thread is a daemon thread (True) or not (False).
995:         raised. Its initial value is inherited from the creating thread; the
996:         main thread is not a daemon thread and therefore all threads created in
997:         the main thread default to daemon = False.
1003:         assert self.__initialized, "Thread.__init__() not called"
1008:             raise RuntimeError("Thread.__init__() not called")
1010:             raise RuntimeError("cannot set daemon status of active thread");
1041: class _Timer(Thread):
1051:         Thread.__init__(self)
1068: # Special thread class to represent the main thread
1074:         Thread.__init__(self, name="MainThread")
1103: # Dummy thread class to represent threads not started here.
1105: # If they invoke anything in threading.py that calls current_thread(), they
1107: # Their purpose is to return *something* from current_thread().
1114:         Thread.__init__(self, name=_newname("Dummy-%d"))
1116:         # Thread.__block consumes an OS-level locking primitive, which
1130:         assert False, "cannot join a dummy thread"
1136:     """Return the current Thread object, corresponding to the caller's thread of control.
1138:     If the caller's thread of control was not created through the threading
1139:     module, a dummy thread object with limited functionality is returned.
1145:         ##print "current_thread(): no current thread for", _get_ident()
1151:     """Return the number of Thread objects currently alive.
1167:     """Return a list of all Thread objects currently alive.
1169:     The list includes daemonic threads, dummy thread objects created by
1170:     current_thread(), and the main thread. It excludes terminated threads and
1177: from thread import stack_size
1179: # Create the main thread object,
1185: # get thread-local implementation, either from the thread
1188: # NOTE: Thread local classes follow: the Grumpy version of this file copies
1196:         key = '_local__key', 'thread.local.' + str(id(self))
1204:         # We need to create the thread dict in anticipation of
1208:         current_thread().__dict__[key] = dict
1214:     d = current_thread().__dict__.get(key)
1217:         current_thread().__dict__[key] = d
1279:         for thread in threads:
1281:                 __dict__ = thread.__dict__
1283:                 # Thread is dying, rest in peace.
1290:                     pass # didn't have anything in this thread
1300:     # by another (non-forked) thread.  http://bugs.python.org/issue874900
1304:     # fork() only copied the current thread; clear references to others.
1306:     current = current_thread()
1308:         for thread in _enumerate():
1311:             if hasattr(thread, '_reset_internal_locks'):
1312:                 thread._reset_internal_locks()
1313:             if thread is current:
1314:                 # There is only one active thread. We reset the ident to
1317:                 thread.__ident = ident
1318:                 new_active[ident] = thread
1321:                 thread.__stop()
1368:             Thread.__init__(self, name="Producer")
1384:             Thread.__init__(self, name="Consumer")
19: #  This threading model was originally inspired by Java, and inherited
29: # Rename some stuff so "from threading import *" is safe
30: __all__ = ['activeCount', 'active_count', 'Condition', 'currentThread',
45:                         module='threading', message='sys.exc_clear')
68:                 # recursion if it has to create a DummyThread on the fly.
91:     """Set a profile function for all threads started from the threading module.
101:     """Set a trace function for all threads started from the threading module.
245:     A condition variable allows one or more threads to wait until they are
256:     """Condition variables allow one or more threads to wait until they are
374:         """Wake up one or more threads waiting on this condition, if any.
379:         This method wakes up at most n of the threads waiting for the condition
380:         variable; it is a no-op if no threads are waiting.
401:         """Wake up all threads waiting on this condition.
449:         which blocked threads are awakened should not be relied on. There is no
579:         All threads waiting for the flag to become true are awakened. Threads
590:         Subsequently, threads calling wait() will block until set() is called to
629: # Main class for threads
643:         *group* should be None; reserved for future extension when a ThreadGroup
683:         if hasattr(self, '__block'):  # DummyThread deletes self.__block
693:         # Overridden in _MainThread and _DummyThread
722:             raise RuntimeError("threads can only be started once")
763:         # reported.  Also, we only suppress them for daemonic threads;
835:                 # test_threading.test_no_refcycle_through_target when
871:         # An instance of _MainThread is always created by 'threading'.  This
874:         # same key in the dict.  So when the _MainThread instance created by
875:         # 'threading' tries to clean itself up when atexit calls this method
879:         # _active if dummy_threading is being used is a red herring.  But
880:         # since it isn't if dummy_threading is *not* being used then don't
891:             if 'dummy_threading' not in _sys.modules:
953:         It has no semantics. Multiple threads may be given the same name. The
983:         returns a list of all alive threads.
999:         The entire Python program exits when no alive non-daemon threads are
1085:         t = _pickSomeNonDaemonThread()
1088:                 self._note("%s: waiting for other threads", self)
1091:             t = _pickSomeNonDaemonThread()
1108: # They are marked as daemon threads so we won't wait for them
1117:         # can never be used by a _DummyThread.  Since a _DummyThread
1146:         return _DummyThread()
1171:     threads that have not yet been started.
1181: # (Py_Main) as threading._shutdown.
1183: _shutdown = _MainThread()._exitfunc
1189: # these from _threading_local.py to avoid circular dependency issues.
1272:             threads = _enumerate()
1274:             # If enumerating the current threads fails, as it seems to do
1292: # END _threading_local.py copy
1296:     # is called from PyOS_AfterFork.  Here we cleanup threading module state
1401:         t = ProducerThread(Q, NI)
1404:     C = ConsumerThread(Q, NI*NP)
850:         # DummyThreads delete self.__block, but they have no waiters to
1295:     # This function is called by Python/ceval.c:PyEval_ReInitThreads which
github.com/html5rocks/slides.html5rocks.com:src/canvasphoto/utilities.js: [ master, ]
333: ...(751 bytes skipped)....subscribe(onTween);this._onComplete.subscribe(onComplete);}};YAHOO.util.AnimMgr=new function(){var thread=null;var queue=[];var tweenCount=0;this.fps=1000;this.delay=1;this.registerElement=function(tween){...(197 bytes skipped)...
83: ...(5 bytes skipped)...n id;};return Y.Dom.batch(el,f,Y.Dom,true)||f.apply(Y.Dom,arguments);},isAncestor:function(haystack,needle){haystack=Y.Dom.get(haystack);if(!haystack||!needle){return false;}
86: return false;};return Y.Dom.batch(needle,f,Y.Dom,true);},inDocument:function(el){var f=function(el){if(isSafari){while(el=el.parentNode){if(...(44 bytes skipped)...
335: return true;};this.start=function(){if(thread===null){thread=setInterval(this.run,this.delay);}};this.stop=function(tween){if(!tween){clearInterval(thread);for(var i=0,len=queue.length;i<len;++i){if(queue[0].isAnimated()){this.unRegister(queue[0],0);}}
336: queue=[];thread=null;tweenCount=0;}
android.googlesource.com/trusty/lk/common:include/kernel/thread.h: [ master, ]
87: typedef struct thread {
45: #define THREAD_STATS 1
46: #define THREAD_STACK_HIGHWATER 1
47: #define THREAD_STACK_BOUNDS_CHECK 1
49: #define THREAD_STACK_PADDING_SIZE 256
53: enum thread_state {
54:     THREAD_SUSPENDED = 0,
55:     THREAD_READY,
56:     THREAD_RUNNING,
57:     THREAD_BLOCKED,
58:     THREAD_SLEEPING,
59:     THREAD_DEATH,
62: typedef int (*thread_start_routine)(void *arg);
65: enum thread_tls_list {
78: #define THREAD_FLAG_DETACHED                  (1U<<0)
79: #define THREAD_FLAG_FREE_STACK                (1U<<1)
80: #define THREAD_FLAG_FREE_STRUCT               (1U<<2)
81: #define THREAD_FLAG_REAL_TIME                 (1U<<3)
82: #define THREAD_FLAG_IDLE                      (1U<<4)
83: #define THREAD_FLAG_DEBUG_STACK_BOUNDS_CHECK  (1U<<5)
85: #define THREAD_MAGIC (0x74687264) // 'thrd'
89:     struct list_node thread_list_node;
128: } thread_t;
131: #define thread_curr_cpu(t) ((t)->curr_cpu)
132: #define thread_pinned_cpu(t) ((t)->pinned_cpu)
133: #define thread_set_curr_cpu(t,c) ((t)->curr_cpu = (c))
134: #define thread_set_pinned_cpu(t, c) ((t)->pinned_cpu = (c))
136: #define thread_curr_cpu(t) (0)
137: #define thread_pinned_cpu(t) (-1)
138: #define thread_set_curr_cpu(t,c) do {} while(0)
139: #define thread_set_pinned_cpu(t, c) do {} while(0)
172: static inline void thread_sleep(lk_time_t delay_ms) {
200: #define THREAD_LOCK(state) spin_lock_saved_state_t state; spin_lock_irqsave(&thread_lock, state)
201: #define THREAD_UNLOCK(state) spin_unlock_irqrestore(&thread_lock, state)
203: static inline bool thread_lock_held(void)
229: struct thread_stats {
247: #define THREAD_STATS_INC(name) do { thread_stats[arch_curr_cpu_num()].name++; } while(0)
251: #define THREAD_STATS_INC(name) do { } while (0)
24: #define __KERNEL_THREAD_H
23: #ifndef __KERNEL_THREAD_H
31: #include <arch/thread.h>
48: #ifndef THREAD_STACK_PADDING_SIZE
64: /* thread local storage */
94:     enum thread_state state;
110:     struct arch_thread arch;
117:     thread_start_routine entry;
124:     /* thread local storage */
142: /* thread priority */
160: void thread_init_early(void);
161: void thread_init(void);
162: void thread_become_idle(void) __NO_RETURN;
163: void thread_secondary_cpu_init_early(void);
164: void thread_secondary_cpu_entry(void) __NO_RETURN;
165: void thread_set_name(const char *name);
166: void thread_set_priority(int priority);
167: thread_t *thread_create(const char *name, thread_start_routine entry, void *arg, int priority, size_t stack_size);
168: thread_t *thread_create_etc(thread_t *t, const char *name, thread_start_routine entry, void *arg, int priority, void *stack, size_t stack_size);
169: status_t thread_resume(thread_t *);
170: void thread_exit(int retcode) __NO_RETURN;
171: void thread_sleep_ns(lk_time_ns_t delay_ns);
173:     thread_sleep_ns(delay_ms * 1000ULL * 1000);
175: status_t thread_detach(thread_t *t);
176: status_t thread_join(thread_t *t, int *retcode, lk_time_t timeout);
177: status_t thread_detach_and_resume(thread_t *t);
178: status_t thread_set_real_time(thread_t *t);
180: void dump_thread(thread_t *t);
181: void arch_dump_thread(thread_t *t);
185: void thread_yield(void); /* give up the cpu voluntarily */
186: void thread_preempt(void); /* get preempted (inserted into head of run queue) */
187: void thread_block(void); /* block on something and reschedule */
188: void thread_unblock(thread_t *t, bool resched); /* go back in the run queue */
191: enum handler_return thread_timer_tick(void);
193: /* the current thread */
194: thread_t *get_current_thread(void);
195: void set_current_thread(thread_t *);
198: extern spin_lock_t thread_lock;
205:     return spin_lock_held(&thread_lock);
208: /* thread local storage */
211:     return get_current_thread()->tls[entry];
216:     uintptr_t oldval = get_current_thread()->tls[entry];
217:     get_current_thread()->tls[entry] = val;
227: /* thread level statistics */
228: #if THREAD_STATS
245: extern struct thread_stats thread_stats[SMP_MAX_CPUS];
182: void dump_all_threads(void);
github.com/apache/activemq-cpp:activemq-cpp/src/main/decaf/util/concurrent/ThreadPoolExecutor.cpp: [ master, ]
153:             Pointer<Thread> thread;
957:         bool prestartCoreThread() {
1353: ThreadPoolExecutor::ThreadPoolExecutor(int corePoolSize, int maxPoolSize,
1382: ThreadPoolExecutor::ThreadPoolExecutor(int corePoolSize, int maxPoolSize,
1414: ThreadPoolExecutor::ThreadPoolExecutor(int corePoolSize, int maxPoolSize,
1446: ThreadPoolExecutor::ThreadPoolExecutor(int corePoolSize, int maxPoolSize,
1690: bool ThreadPoolExecutor::prestartCoreThread() {
1478: ThreadPoolExecutor::~ThreadPoolExecutor() {
315:         bool coreThreadsCanTimeout;
961:         int prestartAllCoreThreads() {
969:         void allowCoreThreadTimeOut(bool value) {
1614: void ThreadPoolExecutor::setThreadFactory(ThreadFactory* factory) {
1627: ThreadFactory* ThreadPoolExecutor::getThreadFactory() const {
1670: void ThreadPoolExecutor::allowCoreThreadTimeout(bool value) {
1685: bool ThreadPoolExecutor::allowsCoreThreadTimeout() const {
1695: int ThreadPoolExecutor::prestartAllCoreThreads() {
61:      * task deletion logic can remain unchanged and thread safe.
102:      * for example when a ThreadFactory fails to create a thread when
114:      *             the thread transitioning to state TIDYING
168:                 AbstractQueuedSynchronizer(), Runnable(), thread(), firstTask(task), kernel(kernel), completedTasks(0) {
175:                 this->thread.reset(kernel->factory->newThread(this));
210:                     setExclusiveOwnerThread(Thread::currentThread());
226:          * to the Timer's thread.
307:          * up on a separate thread because the Worker generally adds itself to the deadWorkers
422:                     worker->thread->join();
593:                     iter->next()->thread->interrupt();
611:          *      currently waiting.  Interrupting any arbitrary thread ensures that
624:                     Pointer<Thread> thread = worker->thread;
625:                     if (!thread->isInterrupted() && worker->tryLock()) {
627:                             thread->interrupt();
656:          * Ensures that unless the pool is stopping, the current thread does not have
661:             if (this->runStateLessThan(ctl.get(), STOP) && Thread::interrupted() &&
664:                 Thread::currentThread()->interrupt();
690:          * usually leads processWorkerExit to replace this thread.
695:          * stopping, this thread does not have its interrupt set.
698:          * might throw an exception, in which case we cause thread to die
708:          * thread's UncaughtExceptionHandler).  Any thrown exception also
709:          * conservatively causes thread to die.
712:          * also throw an exception, which will also cause thread to
717:          * and the thread's UncaughtExceptionHandler have as accurate
732:                         this->parent->beforeExecute(w->thread.get(), task);
796:              * start a new thread with the given command as its first
802:              * to double-check whether we should have added a thread
806:              * stopped, or start a new thread if there are none.
809:              * thread.  If it fails, we know we are shut down or saturated
1106:          * if the thread factory fails to create a thread when asked, which requires
1111:          *      The task the new thread should run first (or null if none).
1153:             Pointer<Thread> t = w->thread;
1187:             // It is possible (but unlikely) for a thread to have been added to
1189:             // could result in a rare missed interrupt, because Thread::interrupt
1190:             // is not guaranteed to have any effect on a non-yet-started Thread
1191:             // (see Thread#interrupt).
1203:          * thread from worker set, and possibly terminates the pool or replaces the
1329:          * abrupt termination of a thread (see processWorkerExit). Other
1710: void ThreadPoolExecutor::beforeExecute(Thread* thread DECAF_UNUSED, Runnable* task DECAF_UNUSED) {
18: #include "ThreadPoolExecutor.h"
89:      *   workerCount, indicating the effective number of threads
93:      * (2^29)-1 (about 500 million) threads rather than (2^31)-1 (2
101:      * transiently different from the actual number of live threads,
103:      * asked, and when exiting threads are still performing
133:      * Threads waiting in awaitTermination() will return when the
172:                         "ThreadPoolExecutor Worker requires non-NULL pointer to parent ExecutorKernel");
217:                 this->setExclusiveOwnerThread(NULL);
291:         ThreadPoolExecutor* parent;
294:          * List containing all worker threads in pool. Accessed only when holding mainLock.
318:          * The queue used for holding tasks and handing off to worker threads.
333:          * Otherwise exiting threads would concurrently interrupt those that have not
349:         Pointer<ThreadFactory> factory;
354:         ExecutorKernel(ThreadPoolExecutor* parent,
357:                        ThreadFactory* threadFactory, RejectedExecutionHandler* handler) :
381:            if(workQueue == NULL || threadFactory == NULL || handler == NULL) {
389:            this->factory.reset(threadFactory);
417:                 // Ensure dead Worker Threads are destroyed, the Timer might not have
586:          * Force an interrupt of all threads even if they are currently active.
603:          * Interrupts threads that might be waiting for tasks (as indicated by not
610:          *      interrupted to propagate shutdown signals in case all threads are
795:              * 1. If fewer than corePoolSize threads are running, try to
799:              * threads when it shouldn't, by returning false.
932:                 // We don't really know how many new threads are "needed".
972:                     "Core threads must have nonzero keep alive times");
990:                     "Core threads must have nonzero keep alive times");
1113:          *      to bypass queuing when there are fewer than corePoolSize threads
1115:          *      (in which case we must bypass queue). Initially idle threads are
1116:          *      usually created via prestartCoreThread or to replace other dying workers.
1157:                 // Recheck while holding lock. Back out on ThreadFactory failure or if
1201:          * worker threads. Unless completedAbruptly is set, assumes that workerCount
1365:         Pointer<RejectedExecutionHandler> handler(new ThreadPoolExecutor::AbortPolicy());
1366:         Pointer<ThreadFactory> threadFactory(Executors::getDefaultThreadFactory());
1370:             threadFactory.get(), handler.get());
1373:         threadFactory.release();
1399:         Pointer<ThreadFactory> threadFactory(Executors::getDefaultThreadFactory());
1403:             threadFactory.get(), handler);
1405:         threadFactory.release();
1417:                                        ThreadFactory* threadFactory) :
1427:         if(threadFactory == NULL) {
1428:             throw NullPointerException(__FILE__, __LINE__, "The ThreadFactory pointer cannot be NULL.");
1431:         Pointer<RejectedExecutionHandler> handler(new ThreadPoolExecutor::AbortPolicy());
1435:             threadFactory, handler.get());
1449:                                        ThreadFactory* threadFactory, RejectedExecutionHandler* handler) :
1463:         if(threadFactory == NULL) {
1464:             throw NullPointerException(__FILE__, __LINE__, "The ThreadFactory pointer cannot be NULL.");
1469:             threadFactory, handler);
1488: void ThreadPoolExecutor::execute(Runnable* task) {
1495:                 "ThreadPoolExecutor::execute - Supplied Runnable pointer was NULL.");
1507: void ThreadPoolExecutor::execute(Runnable* task, bool takeOwnership) {
1514:                 "ThreadPoolExecutor::execute - Supplied Runnable pointer was NULL.");
1526: void ThreadPoolExecutor::shutdown() {
1536: ArrayList<Runnable*> ThreadPoolExecutor::shutdownNow() {
1549: bool ThreadPoolExecutor::awaitTermination(long long timeout, const TimeUnit& unit) {
1559: int ThreadPoolExecutor::getPoolSize() const {
1564: int ThreadPoolExecutor::getCorePoolSize() const {
1569: void ThreadPoolExecutor::setCorePoolSize(int poolSize) {
1579: int ThreadPoolExecutor::getMaximumPoolSize() const {
1584: void ThreadPoolExecutor::setMaximumPoolSize(int maxSize) {
1594: long long ThreadPoolExecutor::getTaskCount() const {
1599: int ThreadPoolExecutor::getActiveCount() const {
1604: long long ThreadPoolExecutor::getCompletedTaskCount() const {
1609: int ThreadPoolExecutor::getLargestPoolSize() const {
1617:         throw NullPointerException(__FILE__, __LINE__, "Cannot assign a NULL ThreadFactory.");
1621:         Pointer<ThreadFactory> temp(factory);
1632: RejectedExecutionHandler* ThreadPoolExecutor::getRejectedExecutionHandler() const {
1637: void ThreadPoolExecutor::setRejectedExecutionHandler(RejectedExecutionHandler* handler) {
1650: BlockingQueue<Runnable*>* ThreadPoolExecutor::getQueue() {
1655: bool ThreadPoolExecutor::isShutdown() const {
1660: bool ThreadPoolExecutor::isTerminated() const {
1665: bool ThreadPoolExecutor::isTerminating() const {
1675: long long ThreadPoolExecutor::getKeepAliveTime(const TimeUnit& unit) const {
1680: void ThreadPoolExecutor::setKeepAliveTime(long long timeout, const TimeUnit& unit) {
1691:     return this->kernel->prestartCoreThread();
1700: bool ThreadPoolExecutor::remove(decaf::lang::Runnable* task) {
1705: void ThreadPoolExecutor::purge() {
1714: void ThreadPoolExecutor::afterExecute(Runnable* task DECAF_UNUSED, decaf::lang::Throwable* error DECAF_UNUSED) ...(1 bytes skipped)...
1718: void ThreadPoolExecutor::terminated() {
1722: void ThreadPoolExecutor::onShutdown() {
366:            coreThreadsCanTimeout(false),
540:          * allow access from ScheduledThreadPoolExecutor.
669:          * State check needed by ScheduledThreadPoolExecutor to enable running
975:             if (value != this->coreThreadsCanTimeout) {
976:                 this->coreThreadsCanTimeout = value;
988:             if (time == 0 && this->coreThreadsCanTimeout) {
1232:                     int min = this->coreThreadsCanTimeout ? 0 : corePoolSize;
1254:          *     {@code allowCoreThreadTimeOut || workerCount > corePoolSize})
1277:                     timed = this->coreThreadsCanTimeout || wc > this->corePoolSize;
1671:     this->kernel->allowCoreThreadTimeOut(value);
1686:     return this->kernel->coreThreadsCanTimeout;
1696:     return this->kernel->prestartAllCoreThreads();
github.com/rosjava/rosjava_core:apache_xmlrpc_common/src/main/java/org/apache/xmlrpc/util/ThreadPool.java: [ kinetic, ]
50:         private Thread thread;
28: public class ThreadPool {
111: 	private final ThreadGroup threadGroup;
123: 	public ThreadPool(int pMaxSize, String pName) {
113: 	private final List waitingThreads = new ArrayList();
114: 	private final List runningThreads = new ArrayList();
226: 	public int getMaxThreads() { return maxSize; }
231:     public synchronized int getNumThreads() { return num; }
25: /** Simple thread pool. A task is executed by obtaining a thread from
29: 	/** The thread pool contains instances of {@link ThreadPool.Task}.
33: 		 * @throws Throwable The task failed, and the worker thread won't be used again.
52:             thread = new Thread(pGroup, pGroup.getName() + "-" + pNum){
80:             thread.start();
93:             synchronized (thread) {
94:                 thread.notify();
105:             synchronized (thread) {
106:                 thread.notify();
121: 	 * @param pName Thread group name.
51:         Poolable(ThreadGroup pGroup, int pNum) {
120: 	 * @param pMaxSize Maximum number of concurrent threads.
125: 		threadGroup = new ThreadGroup(pName);
167: 	 * might consider to use the {@link #addTask(ThreadPool.Task)} method instead.
189:             poolable = new Poolable(threadGroup, num++);
223: 	/** Returns the maximum number of concurrent threads.
224: 	 * @return Maximum number of threads.
228: 	/** Returns the number of threads, which have actually been created,
229:      * as opposed to the number of currently running threads.
129:         runningThreads.remove(pPoolable);
130:         waitingThreads.remove(pPoolable);
138: 	        if (runningThreads.remove(pPoolable)) {
139: 	            if (maxSize != 0  &&  runningThreads.size() + waitingThreads.size() >= maxSize) {
142: 	                waitingThreads.add(pPoolable);
179:         if (maxSize != 0  &&  runningThreads.size() >= maxSize) {
186:         if (waitingThreads.size() > 0) {
187:             poolable = (Poolable) waitingThreads.remove(waitingThreads.size()-1);
191:         runningThreads.add(poolable);
213:         while (!waitingThreads.isEmpty()) {
214:             Poolable poolable = (Poolable) waitingThreads.remove(waitingThreads.size()-1);
217:         while (!runningThreads.isEmpty()) {
218:             Poolable poolable = (Poolable) runningThreads.remove(runningThreads.size()-1);
github.com/googleapis/elixir-google-api:clients/chat/lib/google_api/chat/v1/model/thread.ex: [ master, ]
18: defmodule GoogleApi.Chat.V1.Model.Thread do
20:   A thread in Hangouts Chat.
38: defimpl Poison.Decoder, for: GoogleApi.Chat.V1.Model.Thread do
40:     GoogleApi.Chat.V1.Model.Thread.decode(value, options)
44: defimpl Poison.Encoder, for: GoogleApi.Chat.V1.Model.Thread do
24:   *   `name` (*type:* `String.t`, *default:* `nil`) - Resource name, in the form "spaces/*/threads/*".
26:       Example: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4
github.com/apache/logging-log4cxx:src/main/cpp/threadcxx.cpp: [ master, ]
92: 		Thread* thread;
153: Thread::Thread() : thread(NULL), alive(0), interruptedStatus(0),
158: Thread::~Thread()
68: 		Thread* getThread() const
291: bool Thread::isCurrentThread() const
131: ThreadLocal& getThreadLocal()
245: void Thread::currentThreadInterrupt()
19: #include <log4cxx/helpers/thread.h>
21: #include <apr_thread_proc.h>
26: #include <apr_thread_cond.h>
36:  *   Thread::run when they are passed to Thread::launcher.
46: 		 *  before thread is launched.
61: 		LaunchPackage(Thread* t, Runnable r, void* d) : thread(t), runnable(r), data(d)
65: 		 * Gets thread parameter.
66: 		 * @return thread.
70: 			return thread;
83: 		 *  @return thread.
100:  *  Used to maintain Thread.alive.
128:  *   Get a key to the thread local storage used to hold the reference to
129:  *   the corresponding Thread object.
139: void* LOG4CXX_THREAD_FUNC ThreadLaunch::launcher(apr_thread_t* thread, void* data)
145: 		(package->getRunnable())(thread, package->getData());
148: 	apr_thread_exit(thread, 0); // this function never returns !
165: void Thread::run(Runnable start, void* data)
175: 	// now we're ready to create the thread again
177: 	//    if attempting a second run method on the same Thread object
180: 	if (thread != NULL)
193: 	stat = apr_thread_cond_create(&interruptedCondition, p.getAPRPool());
200: 	stat = apr_thread_mutex_create(&interruptedMutex, APR_THREAD_MUTEX_NESTED,
208: 	//   create LaunchPackage on the thread's memory pool
210: 	stat = apr_thread_create(&thread, attrs,
219: 	// if run() has been called in a thread-safe way.
226: void Thread::join()
230: 	if (thread != NULL)
233: 		apr_status_t stat = apr_thread_join(&startStat, thread);
234: 		thread = NULL;
252: 		((Thread*) tls)->interrupt();
258: void Thread::interrupt()
266: 		apr_status_t stat = apr_thread_cond_signal(interruptedCondition);
277: bool Thread::interrupted()
284: 		return apr_atomic_xchg32(&(((Thread*) tls)->interruptedStatus), 0) != 0;
301: bool Thread::isAlive()
306: void Thread::ending()
312: void Thread::sleep(int duration)
323: 		Thread* pThis = (Thread*) getThreadLocal().get();
332: 			apr_status_t stat = apr_thread_cond_timedwait(pThis->interruptedCondition,
24: #include <log4cxx/helpers/threadlocal.h>
31: #if APR_HAS_THREADS
133: 	static ThreadLocal tls;
142: 	ThreadLocal& tls = getThreadLocal();
143: 	tls.set(package->getThread());
146: 		package->getThread()->ending();
167: #if APR_HAS_THREADS
185: 	apr_threadattr_t* attrs;
186: 	apr_status_t stat = apr_threadattr_create(&attrs, p.getAPRPool());
190: 		throw ThreadException(stat);
197: 		throw ThreadException(stat);
205: 		throw ThreadException(stat);
211: 			ThreadLaunch::launcher, package, p.getAPRPool());
215: 		throw ThreadException(stat);
222: 	throw ThreadException(LOG4CXX_STR("APR_HAS_THREADS is not true"));
228: #if APR_HAS_THREADS
238: 			throw ThreadException(stat);
247: #if APR_HAS_THREADS
261: #if APR_HAS_THREADS
270: 			throw ThreadException(stat);
279: #if APR_HAS_THREADS
293: #if APR_HAS_THREADS
314: #if APR_HAS_THREADS
337: 				throw ThreadException(stat);
248: 	void* tls = getThreadLocal().get();
280: 	void* tls = getThreadLocal().get();
294: 	const void* tls = getThreadLocal().get();
github.com/googlegsa/sharepoint.v3:projects/ApacheHttpClient/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java: [ master, ]
1046:         public Thread thread;
93:     private static ReferenceQueueThread REFERENCE_QUEUE_THREAD;
917:         public synchronized void notifyWaitingThread(HostConfiguration configuration) {
928:         public synchronized void notifyWaitingThread(HostConnectionPool hostPool) {
1044:     private static class WaitingThread {
1061:     private static class ReferenceQueueThread extends Thread {
1068:         public ReferenceQueueThread() {
65: public class MultiThreadedHttpConnectionManager implements HttpConnectionManager {
256:     public MultiThreadedHttpConnectionManager() {
706:         private LinkedList waitingThreads = new LinkedList();
1034:         public LinkedList waitingThreads = new LinkedList();
91:      * The thread responsible for handling lost connections.
134:             if (REFERENCE_QUEUE_THREAD != null) {
135:                 REFERENCE_QUEUE_THREAD.shutdown();
136:                 REFERENCE_QUEUE_THREAD = null;
171:             // start the reference queue thread if needed
172:             if (REFERENCE_QUEUE_THREAD == null) {
173:                 REFERENCE_QUEUE_THREAD = new ReferenceQueueThread();
174:                 REFERENCE_QUEUE_THREAD.start();
507:                             waitingThread.thread = Thread.currentThread();
531:                             // interrupted by an external thread.  Regardless we need to 
624:      * If another thread is blocked in getConnection() that could use this
741:                 waiter.thread.interrupt();
912:          * Notifies a waiting thread that a connection for the given configuration is 
922:          * Notifies a waiting thread that a connection for the given configuration is 
923:          * available.  This will wake a thread waiting in this host pool or if there is not
924:          * one a thread in the connection pool will be notified.
930:             // find the thread we are going to notify, we want to ensure that each
931:             // waiting thread is only interrupted once so we will remove it from 
937:                     LOG.debug("Notifying thread waiting on host pool, hostConfig=" 
944:                     LOG.debug("No-one waiting on host pool, notifying next waiting thread.");
954:                 waitingThread.thread.interrupt();
1041:      * A simple struct-like class to combine the waiting thread and the connection 
1045:         /** The thread that is waiting for a connection */
1048:         /** The connection pool the thread is waiting for */
1051:         /** Flag to indicate if the thread was interrupted by the ConnectionPool. Set
1053:          * before the thread is interrupted. */
1058:      * A thread for listening for HttpConnections reclaimed by the garbage
1066:          * Create an instance and make this a daemon thread.
105:      * MultiThreadedHttpConnectionManager. All static resources are released, all threads are 
453:             WaitingThread waitingThread = null;
492:                     // threads, so they avoid being sacrificed before necessary
504:                         if (waitingThread == null) {
505:                             waitingThread = new WaitingThread();
506:                             waitingThread.hostConnectionPool = hostPool;
509:                             waitingThread.interruptedByConnectionPool = false;
516:                         hostPool.waitingThreads.addLast(waitingThread);
517:                         connectionPool.waitingThreads.addLast(waitingThread);
520:                         if (!waitingThread.interruptedByConnectionPool) {
529:                         if (!waitingThread.interruptedByConnectionPool) {
533:                             hostPool.waitingThreads.remove(waitingThread);
534:                             connectionPool.waitingThreads.remove(waitingThread);
735:             // interrupt all waiting threads
738:                 WaitingThread waiter = (WaitingThread) iter.next();
777:          * connection counts and notifies waiting threads, if appropriate.
787:             notifyWaitingThread(config);
915:          * @see #notifyWaitingThread(HostConnectionPool)
918:             notifyWaitingThread(getHostPool(configuration));
933:             WaitingThread waitingThread = null;
940:                 waitingThread = (WaitingThread) hostPool.waitingThreads.removeFirst();
941:                 waitingThreads.remove(waitingThread);
946:                 waitingThread = (WaitingThread) waitingThreads.removeFirst();
947:                 waitingThread.hostConnectionPool.waitingThreads.remove(waitingThread);
949:                 LOG.debug("Notifying no-one, there are no waiting threads");
952:             if (waitingThread != null) {
953:                 waitingThread.interruptedByConnectionPool = true;
1004:                 notifyWaitingThread(hostPool);
1052:          * to true inside {@link ConnectionPool#notifyWaitingThread(HostConnectionPool)} 
1115:                     LOG.debug("ReferenceQueueThread interrupted", e);
2: ...(43 bytes skipped)...ommons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java,v 1.47 2004/12/21 11:27:55 olegk Exp $
70:     private static final Log LOG = LogFactory.getLog(MultiThreadedHttpConnectionManager.class);
107:      * MultiThreadedHttpConnectionManager.
118:                 MultiThreadedHttpConnectionManager[]
119:                     connManagers = (MultiThreadedHttpConnectionManager[])
121:                         new MultiThreadedHttpConnectionManager
522:                             throw new IllegalThreadStateException(
523:                                 "Interrupted while waiting in MultiThreadedHttpConnectionManager");
705:         /** The list of WaitingThreads waiting for a connection */
736:             iter = waitingThreads.iterator();
764:             connection.getParams().setDefaults(MultiThreadedHttpConnectionManager.this.params);
765:             connection.setHttpConnectionManager(MultiThreadedHttpConnectionManager.this);
935:             if (hostPool.waitingThreads.size() > 0) {
942:             } else if (waitingThreads.size() > 0) {
1033:         /** The list of WaitingThreads for this host */
1070:             setName("MultiThreadedHttpConnectionManager cleanup");
github.com/google/starlark-go:starlark/eval.go: [ master, ]
29: type Thread struct {
26: // A Thread contains the state of a Starlark thread,
27: // such as its call stack and thread-local storage.
28: // The Thread is threaded throughout the evaluator.
30: 	// Name is an optional name that describes the thread, for debugging.
39: 	Print func(thread *Thread, msg string)
47: 	Load func(thread *Thread, module string) (StringDict, error)
49: 	// locals holds arbitrary "thread-local" Go values belonging to the client.
57: // SetLocal sets the thread-local value associated with the specified key.
59: func (thread *Thread) SetLocal(key string, value interface{}) {
60: 	if thread.locals == nil {
61: 		thread.locals = make(map[string]interface{})
63: 	thread.locals[key] = value
66: // Local returns the thread-local value associated with the specified key.
67: func (thread *Thread) Local(key string) interface{} {
68: 	return thread.locals[key]
76: func (thread *Thread) CallFrame(depth int) CallFrame {
77: 	return thread.frameAt(depth).asCallFrame()
80: func (thread *Thread) frameAt(depth int) *frame {
81: 	return thread.stack[len(thread.stack)-1-depth]
84: // CallStack returns a new slice containing the thread's stack of call frames.
85: func (thread *Thread) CallStack() CallStack {
86: 	frames := make([]CallFrame, len(thread.stack))
87: 	for i, fr := range thread.stack {
94: func (thread *Thread) CallStackDepth() int { return len(thread.stack) }
189: // a copy of the thread's stack at the moment of the error.
210: func (thread *Thread) evalError(err error) *EvalError {
213: 		CallStack: thread.CallStack(),
269: // Thread is the state associated with the Starlark thread.
283: func ExecFile(thread *Thread, filename string, src interface{}, predeclared StringDict) (StringDict, error) {
290: 	g, err := mod.Init(thread, predeclared)
359: func (prog *Program) Init(thread *Thread, predeclared StringDict) (StringDict, error) {
362: 	_, err := Call(thread, toplevel, nil, nil)
369: // ExecREPLChunk compiles and executes file f in the specified thread
377: func ExecREPLChunk(f *syntax.File, thread *Thread, globals StringDict) error {
408: 	_, err := Call(thread, toplevel, nil, nil)
461: func Eval(thread *Thread, filename string, src interface{}, env StringDict) (Value, error) {
470: 	return Call(thread, f, nil, nil)
485: func EvalExpr(thread *Thread, expr syntax.Expr, env StringDict) (Value, error) {
490: 	return Call(thread, fn, nil, nil)
896: 			needle, ok := x.(String)
900: 			return Bool(strings.Contains(string(y), string(needle))), nil
1062: func Call(thread *Thread, fn Value, args Tuple, kwargs []Tuple) (Value, error) {
1070: 	// Optimization: use slack portion of thread.stack
1072: 	if n := len(thread.stack); n < cap(thread.stack) {
1073: 		fr = thread.stack[n : n+1][0]
1078: 	thread.stack = append(thread.stack, fr) // push
1082: 	thread.beginProfSpan()
1083: 	result, err := c.CallInternal(thread, args, kwargs)
1084: 	thread.endProfSpan()
1094: 			err = thread.evalError(err)
1099: 	thread.stack = thread.stack[:len(thread.stack)-1] // pop
github.com/apache/attic-polygene-sandbox:libraries/thread/src/main/java/org/qi4j/library/thread/PooledThreadServiceMixin.java: [ master, ]
105:         private final Thread thread;
18: package org.qi4j.library.thread;
33:     @Service private ThreadGroupService threadGroupService;
35:     private int threadCount;
43:     public Thread newThread( Runnable runnable )
78:     private void createNewThread()
103:     public static class RunnableThread
108:         public RunnableThread( Thread thread, PooledRunnableWrapper runnable )
28: public class PooledThreadServiceMixin
37:     public PooledThreadServiceMixin()
58:             return rt.thread;
85:         Thread t = new Thread( group, runnable, name );
95:         for( RunnableThread thread : pool )
98:             thread.runnable.run = false;
99:             thread.thread.interrupt();
110:             this.thread = thread;
29:     implements ThreadService, Activatable
31:     @This private Configuration<ThreadServiceConfiguration> config;
34:     private LinkedList<RunnableThread> pool;
39:         pool = new LinkedList<RunnableThread>();
40:         threadCount = 0;
50:                 if( threadCount >= max )
54:                 createNewThread();
56:             RunnableThread rt = pool.removeFirst();
62:     public ThreadServiceConfiguration configuration()
70:         pool = new LinkedList<RunnableThread>();
74:             createNewThread();
80:         ThreadServiceConfiguration configuration = config.configuration();
81:         String tgName = configuration.threadGroupName().get();
82:         ThreadGroup group = threadGroupService.getThreadGroup( tgName );
83:         String name = configuration.threadBaseName().get() + "-" + sequence.newSequenceValue();
86:         RunnableThread runnableThread = new RunnableThread( t, runnable );
87:         runnable.poolInstance = runnableThread;
88:         threadCount++;
89:         pool.add( runnableThread );
97:             threadCount = 0;
120:         private RunnableThread poolInstance;
49:                 Integer max = config.configuration().maxThreads().get();
52:                     throw new MaximumThreadsException( max );
71:         int prefered = config.configuration().preferedNumberOfThreads().get();
github.com/google/skylark:eval.go: [ master, ]
29: type Thread struct {
26: // A Thread contains the state of a Skylark thread,
27: // such as its call stack and thread-local storage.
28: // The Thread is threaded throughout the evaluator.
36: 	Print func(thread *Thread, msg string)
44: 	Load func(thread *Thread, module string) (StringDict, error)
46: 	// locals holds arbitrary "thread-local" Go values belonging to the client.
51: // SetLocal sets the thread-local value associated with the specified key.
53: func (thread *Thread) SetLocal(key string, value interface{}) {
54: 	if thread.locals == nil {
55: 		thread.locals = make(map[string]interface{})
57: 	thread.locals[key] = value
60: // Local returns the thread-local value associated with the specified key.
61: func (thread *Thread) Local(key string) interface{} {
62: 	return thread.locals[key]
67: func (thread *Thread) Caller() *Frame { return thread.frame.parent }
70: func (thread *Thread) TopFrame() *Frame { return thread.frame }
117: // The Frames of a thread are structured as a spaghetti stack, not a
217: // Thread is the state associated with the Skylark thread.
231: func ExecFile(thread *Thread, filename string, src interface{}, predeclared StringDict) (StringDict, error) {
238: 	g, err := mod.Init(thread, predeclared)
280: func (prog *Program) Init(thread *Thread, predeclared StringDict) (StringDict, error) {
283: 	_, err := Call(thread, toplevel, nil, nil)
328: func Eval(thread *Thread, filename string, src interface{}, env StringDict) (Value, error) {
341: 	return Call(thread, fn, nil, nil)
724: 			needle, ok := x.(String)
728: 			return Bool(strings.Contains(string(y), string(needle))), nil
850: func Call(thread *Thread, fn Value, args Tuple, kwargs []Tuple) (Value, error) {
856: 	thread.frame = &Frame{parent: thread.frame, callable: c}
857: 	result, err := c.CallInternal(thread, args, kwargs)
858: 	thread.frame = thread.frame.parent
android.googlesource.com/platform/external/rust/crates/syn:1.0.7/src/lib.rs: [ master, ]
775: mod thread;
131: //!     bad: std::thread::Thread,
141: //! error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
144: //! 7 |     bad: std::thread::Thread,
145: //!   |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `Thread`
255:     clippy::needless_doctest_main,
256:     clippy::needless_pass_by_value,
github.com/apache/commons-io:src/main/java/org/apache/commons/io/ThreadMonitor.java: [ master, ]
42:     private final Thread thread;
40: class ThreadMonitor implements Runnable {
94:     private ThreadMonitor(final Thread thread, final long timeout) {
20:  * Monitors a thread, interrupting it if it reaches the specified timeout.
23:  * interrupting the thread being monitored. If the thread being monitored
25:  * the <i>monitor</i> thread.
31:  *           Thread monitor = ThreadMonitor.start(timeoutInMillis);
46:      * Start monitoring the current thread.
50:      * @return The monitor thread or {@code null}
53:     public static Thread start(final long timeout) {
54:         return start(Thread.currentThread(), timeout);
58:      * Start monitoring the specified thread.
60:      * @param thread The thread The thread to monitor
63:      * @return The monitor thread or {@code null}
66:     public static Thread start(final Thread thread, final long timeout) {
67:         Thread monitor = null;
69:             final ThreadMonitor timout = new ThreadMonitor(thread, timeout);
70:             monitor = new Thread(timout, ThreadMonitor.class.getSimpleName());
78:      * Stop monitoring the specified thread.
80:      * @param thread The monitor thread, may be {@code null}
82:     public static void stop(final Thread thread) {
83:         if (thread != null) {
84:             thread.interrupt();
91:      * @param thread The thread to monitor
95:         this.thread = thread;
101:      * interrupt the thread being monitored.
109:             thread.interrupt();
118:      * This method exists because Thread.sleep(100) can sleep for 0, 70, 100 or 200ms or anything else
119:      * it deems appropriate. Read the docs on Thread.sleep for further interesting details.
128:             Thread.sleep(remaining);
33:  *           ThreadMonitor.stop(monitor);
android.googlesource.com/platform/external/rust/crates/syn:0.15.42/src/lib.rs: [ master, ]
570: mod thread;
132: //!     bad: std::thread::Thread,
142: //! error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied
145: //! 7 |     bad: std::thread::Thread,
146: //!   |     ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `Thread`
252:         needless_pass_by_value,
android.googlesource.com/platform/system/nfc:src/adaptation/NfcAdaptation.cc: [ master, ]
438: uint32_t NfcAdaptation::Thread(__attribute__((unused)) uint32_t arg) {
796: ThreadMutex::ThreadMutex() {
846: ThreadCondVar::ThreadCondVar() {
813: ThreadMutex::~ThreadMutex() { pthread_mutex_destroy(&mMutex); }
864: ThreadCondVar::~ThreadCondVar() { pthread_cond_destroy(&mCondVar); }
903: AutoThreadMutex::AutoThreadMutex(ThreadMutex& m) : mm(m) { mm.lock(); }
914: AutoThreadMutex::~AutoThreadMutex() { mm.unlock(); }
262:   // Android already logs thread_id, proc_id, timestamp, so disable those.
343:     GKI_create_task((TASKPTR)Thread, MMI_TASK, (int8_t*)"NFCA_THREAD", nullptr, 0,
405: ** Description: signal the CondVar to release the thread that is waiting
431: ** Function:    NfcAdaptation::Thread()
439:   const char* func = "NfcAdaptation::Thread";
57: ThreadMutex NfcAdaptation::sLock;
60: ThreadCondVar NfcAdaptation::mHalOpenCompletedEvent;
61: ThreadCondVar NfcAdaptation::mHalCloseCompletedEvent;
278:     // of a byte array is ambiguous and needlessly difficult to configure.
340:                   (pthread_cond_t*)nullptr, nullptr);
344:                     (pthread_cond_t*)nullptr, nullptr);
433: ** Description: Creates work threads
443:     ThreadCondVar CondVar;
446:                     (pthread_cond_t*)CondVar, (pthread_mutex_t*)CondVar);
789: ** Function:    ThreadMutex::ThreadMutex()
797:   pthread_mutexattr_t mutexAttr;
799:   pthread_mutexattr_init(&mutexAttr);
800:   pthread_mutex_init(&mMutex, &mutexAttr);
801:   pthread_mutexattr_destroy(&mutexAttr);
806: ** Function:    ThreadMutex::~ThreadMutex()
817: ** Function:    ThreadMutex::lock()
824: void ThreadMutex::lock() { pthread_mutex_lock(&mMutex); }
828: ** Function:    ThreadMutex::unblock()
835: void ThreadMutex::unlock() { pthread_mutex_unlock(&mMutex); }
839: ** Function:    ThreadCondVar::ThreadCondVar()
847:   pthread_condattr_t CondAttr;
849:   pthread_condattr_init(&CondAttr);
850:   pthread_cond_init(&mCondVar, &CondAttr);
852:   pthread_condattr_destroy(&CondAttr);
857: ** Function:    ThreadCondVar::~ThreadCondVar()
868: ** Function:    ThreadCondVar::wait()
875: void ThreadCondVar::wait() {
876:   pthread_cond_wait(&mCondVar, *this);
877:   pthread_mutex_unlock(*this);
882: ** Function:    ThreadCondVar::signal()
889: void ThreadCondVar::signal() {
891:   pthread_cond_signal(&mCondVar);
168:   AutoThreadMutex a(sLock);
342:     AutoThreadMutex guard(mCondVar);
363:   AutoThreadMutex a(sLock);
444:     AutoThreadMutex guard(CondVar);
890:   AutoThreadMutex a(*this);
896: ** Function:    AutoThreadMutex::AutoThreadMutex()
907: ** Function:    AutoThreadMutex::~AutoThreadMutex()
github.com/apache/xerces2-j:tests/thread/Test.java: [ trunk, ]
18: package thread;
657: class thread extends Thread {
661:     thread (ThreadInfo param) {
104: class ThreadInfo
111:     ThreadInfo() {
140: class ThreadParser extends HandlerBase
171: ThreadParser()
84:     int         numThreads;
109:     int        fThreadNum;      // Identifying number for this thread.
126: ThreadInfo      gThreadInfo[];
66:     int     checkSum;        // The XML checksum.  Set up by the main thread for
98: //  struct threadInfo  Holds information specific to an individual thread.
99: //                     One of these is set up for each thread in the test.
106:     boolean    fHeartBeat;      // Set true by the thread each time it finishes
577:         System.err.print("usage: java thread.Test [-v] [-threads nnn] [-time nnn] [-quiet] [-verbose] xmlfile...\n" +
600: //                          thread, before all of the worker threads are started.
649: //               thread termination.  Threads are stuck running here
651: //               main thread of the process (which never calls this
670:         System.out.println("Thread " + thInfo.fThreadNum + ": starting");
692:             System.out.println("Thread " + thInfo.fThreadNum +
726: } // class thread
796:         thread t = new thread(gThreadInfo[threadNum]);
803:     //                 display "." if some thread hasn't since previous "+"
811:             Thread.sleep(1000);
839:     //  To Do:  Run the main thread at higher priority, so that the worker threads
40:  * This program is a straight port of xerces/c/tests/ThreadTest.cpp
56: //                      and can safely be referenced by the test threads without
67:                              //   each file before the worker threads are started.
75: //                     During the test, the threads will access this info without
100: //                     The main program monitors the threads by looking
132: //  class ThreadParser   Bundles together a SAX parser and the SAX handlers
137: //                       in different threads.
168: //  ThreadParser constructor.  Invoked by the threads of the test program
263: //  addToCheckSum - private function, used within ThreadParser in
275: //  addToCheckSum - private function, used within ThreadParser in
468: } // class ThreadParser
516:             else if (argv[argnum].equals("-threads"))
583:             "     -threads nnn   Number of threads.  Default is 2. \n" +
644: //  threadMain   The main function for each of the swarm of test threads.
659:     ThreadInfo thInfo;
667:     ThreadParser thParser = null;
682:             thParser = new ThreadParser();
701:             System.err.println("\nThread " + thInfo.fThreadNum +
747:     // While we are still single threaded, parse each of the documents
751:     ThreadParser mainParser = new ThreadParser();
783:     //  Fire off the requested number of parallel threads
789:     gThreadInfo = new ThreadInfo[gRunInfo.numThreads];
791:     int threadNum;
792:     for (threadNum=0; threadNum < gRunInfo.numThreads; threadNum++)
794:         gThreadInfo[threadNum] = new ThreadInfo();
795:         gThreadInfo[threadNum].fThreadNum = threadNum;
801:     //  Loop, watching the heartbeat of the worker threads.
802:     //    Each second, display "+" when all threads have completed a parse
819:             for (threadNum=0; threadNum < gRunInfo.numThreads; threadNum++)
821:                 if (gThreadInfo[threadNum].fHeartBeat == false)
830:                 for (threadNum=0; threadNum < gRunInfo.numThreads; threadNum++)
831:                     gThreadInfo[threadNum].fHeartBeat = false;
838:     //  Tally up the total number of parses completed by each of the threads.
843:     for (threadNum=0; threadNum < gRunInfo.numThreads; threadNum++)
845:         totalParsesCompleted += gThreadInfo[threadNum].fParses;
853:     //  The threads are still running; we just return
114:         fThreadNum = -1;
487:     gRunInfo.numThreads = 2;
522:                     gRunInfo.numThreads = Integer.parseInt(argv[argnum]);
527:                 if (gRunInfo.numThreads < 0)
786:     if (gRunInfo.numThreads == 0)
github.com/kubernetes/minikube:site/themes/docsy/userguide/package-lock.json: [ master, ]
1098:             "needle": "^2.2.1",
1079:         "needle": {
github.com/apache/kafka:clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java: [ trunk, ]
301:     private final Thread thread;
1155:         private boolean threadShouldExit(long now, long curHardShutdownTimeMs) {
259:     static final String NETWORK_THREAD_PREFIX = "kafka-admin-client-thread";
257:      * Thread name prefix for admin client network thread
294:      * The runnable used in the service thread for this admin client.
299:      * The network service thread for this admin client.
305:      * and force the RPC thread to exit. If the admin client is not closing, this will be 0.
310:      * A factory which creates TimeoutProcessors for the RPC thread.
511:         String threadName = NETWORK_THREAD_PREFIX + " | " + clientId;
512:         this.thread = new KafkaThread(threadName, runnable, true);
520:         thread.start();
543:                 client.wakeup(); // Wake the thread, if it is blocked inside poll().
555:             log.debug("Waiting for the I/O thread to exit. Hard shutdown in {} ms.", deltaMs);
558:             // close() can be called by AdminClient thread when it invokes callback. That will
560:             if (Thread.currentThread() != thread) {
561:                 // Wait for the thread to be joined.
562:                 thread.join(waitTimeMs);
566:             log.debug("Interrupted while joining I/O thread", e);
567:             Thread.currentThread().interrupt();
855:          * Only accessed from this thread.
861:          * Only accessed from this thread.
867:          * Only accessed from this thread.
873:          * Only accessed from this thread.
879:          * This will be null only if the thread has shut down.
1157:                 log.trace("All work has been completed, and the I/O thread is now exiting.");
1161:                 log.info("Forcing a hard I/O thread shutdown. Requests in progress will be aborted.");
1170:             log.trace("Thread starting");
1179:                     numTimedOut += timeoutProcessor.handleTimeouts(newCalls, "The AdminClient thread has exited.");
1182:                 numTimedOut += timeoutProcessor.handleTimeouts(pendingCalls, "The AdminClient thread has exited.");
1185:                         "The AdminClient thread has exited.");
1191:                 log.debug("Exiting AdminClientRunnable thread.");
1201:                 // Check if the AdminClient thread should shut down.
1256:          * If the AdminClient thread has exited, this will fail. Otherwise, it will succeed (even
1275:                 client.wakeup(); // wake the thread if it is in poll()
1277:                 log.debug("The AdminClient thread has exited. Timing out {}.", call);
1278:                 call.fail(Long.MAX_VALUE, new TimeoutException("The AdminClient thread has exited."));
1293:                 call.fail(Long.MAX_VALUE, new TimeoutException("The AdminClient thread is not accepting new calls."));
190: import org.apache.kafka.common.utils.KafkaThread;
1203:                 if ((curHardShutdownTimeMs != INVALID_SHUTDOWN_TIME) && threadShouldExit(now, curHardShutdownTimeMs))
github.com/kubernetes/minikube:site/package-lock.json: [ master, ]
1098:             "needle": "^2.2.1",
1079:         "needle": {
github.com/tensorflow/playground:package-lock.json: [ master, ]
1628:             "needle": "^2.2.1",
1609:         "needle": {
github.com/osxfuse/osxfuse:prefpane/externals/google-toolbox-for-mac/XcodePlugin/XcodeHeaders/DevToolsInterface.h: [ master, ]
4872: - (id)thread;
4528:     PBXLSThread *_selectedThread;
4540: - (id)selectedThread;
4689: - (id)threadViewModule;
4771: - (id)selectedThread;
4875: - (BOOL)threadIsRunning;
4876: - (BOOL)threadIsRunningButNotStepping;
4877: - (BOOL)threadStepDidTimeout;
4878: - (BOOL)threadIsSteppable;
4899: - (void)continueThread;
7806: + (void)_startCrashCatchingServiceThread;
11480: - (void)threadRequestUpdateStack:(id)fp8;
11481: - (void)threadRequestStepInstruction:(id)fp8;
11482: - (void)threadRequestNextInstruction:(id)fp8;
11483: - (void)threadRequestStepInto:(id)fp8;
11484: - (void)threadRequestStepOver:(id)fp8;
11485: - (void)threadRequestStepOut:(id)fp8;
11487: - (void)threadRequestContinue:(id)fp8;
11862:     PBXLSThread *_currentThread;
11876: - (id)currentThread;
11883: - (id)threadGroups;
11884: - (id)threadGroupWithName:(id)fp8;
11887: - (id)threads;
11888: - (id)threadWithHandle:(unsigned long)fp8;
11909: - (id)parentThread;
11923: - (void)threadDidUpdate;
11939: @interface PBXLSThread : PBXLSModel
11967: - (int)threadState;
11968: - (int)threadStateStatus;
11997: - (id)threads;
14973:     NSThread *_taskThread;
4527:     NSPopUpButtonCell *_threadsPopUp;
4539: - (void)selectThread:(id)fp8;
4544: - (void)setSelectedThread:(id)fp8;
4554:     PBXDebugThreadViewModule *_threadViewModule;
4770: - (void)setSelectedThread:(id)fp8;
4858:     PBXDebugStackTableHeaderCell *_threadsTablePopUp;
11885: - (id)_threadsOfType:(int)fp8;
11941:     int _threadState;
11943:     int _threadStateStatus;
558: - (BOOL)usesThreadedAnimation;
559: - (void)setUsesThreadedAnimation:(BOOL)fp8;
3033: - (void)_finishSpeculativeCompilationInSeparateThreadWithSpecCompInfo:(id)fp8;
4535: - (id)selectedThreadViewModule;
4537: - (BOOL)allThreadsStopped;
4541: - (void)_emptyThreadsPopUp;
4546: - (void)setThreadsPopUp:(id)fp8;
4552:     PBXDebugProcessAndThreadModule *_processAndThreadModule;
4851: @interface PBXDebugThreadViewModule : PBXDebugDSModelViewModule
4867: - (id)stackTableThreadsPopUp;
7563: @interface PBXDebugProcessAndThreadModule : PBXDebugViewModule
11457: - (void)destroyThreadWithThreadHandle:(unsigned long)fp8;
11461: - (void)willUpdateThreads;
11462: - (void)didUpdateThreads;
11505: - (oneway void)requestSuspendAllThreads;
11872: - (void)debuggerWillUpdateThreads:(id)fp8;
11881: - (void)debuggerDidUpdateThreads:(id)fp8;
11886: - (id)nonRunningThreads;
11958: - (id)parentThreadGroup;
11983: @interface PBXLSThreadGroup : PBXLSModel
13118: - (BOOL)usesThreadedAnimation;
13119: - (void)setUsesThreadedAnimation:(BOOL)fp8;
13379: + (BOOL)useThreadedAnimation;
20671: - (BOOL)usesThreadedAnimation;
20672: - (void)setUsesThreadedAnimation:(BOOL)fp8;
11458: - (id)threadGroupWithName:(id)fp8 create:(BOOL)fp12;
11459: - (oneway void)setState:(int)fp8 status:(int)fp12 isCurrentThread:(BOOL)fp16 forServerThreadHandle:(unsigned long)fp20;
11486: - (void)threadRequest:(byref id)fp8 stepUntilLineNumber:(unsigned int)fp12;
11494: - (void)requestDebuggerMovePCInThread:(unsigned long)fp8 fileSpec:(id)fp12;
11640: - (void)requestPrintDescriptionInThread:(id)fp8 atStackFrame:(id)fp12;
11875: - (void)debugger:(id)fp8 setCurrentThread:(id)fp12;
11995: - (void)debugger:(id)fp8 addThread:(id)fp12;
11996: - (void)debugger:(id)fp8 removeThread:(id)fp12;
11455: - (void)createThreadWithThreadHandle:(unsigned long)fp8 name:(id)fp12 inThreadGroupNamed:(id)fp16;
11873: - (void)debugger:(id)fp8 addThreadGroup:(id)fp12;
11874: - (void)debugger:(id)fp8 removeThreadGroup:(id)fp12;
11970: - (void)debugger:(id)fp8 setThreadState:(int)fp12 status:(int)fp16;
14988: - (BOOL)detachNewThreadSelector:(SEL)fp8 cancelSelector:(SEL)fp12 toTarget:(id)fp16 withObject:(id)fp20;
github.com/google/j2objc:jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/CompletableFuture.java: [ master, ]
1695:         volatile Thread thread;
406:     static final class ThreadPerTaskExecutor implements Executor {
2660:             public Thread newThread(Runnable r) {
2659:         static final class DaemonThreadFactory implements ThreadFactory {
62:  * <em>non-async</em> methods may be performed by the thread that
69:  * which case, a new Thread is created to run each task).
76:  * class maintains at most one daemon thread for triggering and
174:      *   invocation if already claimed by another thread.
407:         public void execute(Runnable r) { new Thread(r).start(); }
530:          * thread claims ownership.  If async, starts as task -- a
1684:      * Completion for recording and releasing a waiting thread.  This
1698:             this.thread = Thread.currentThread();
1704:             Thread w; // no need to atomically claim
1705:             if ((w = thread) != null) {
1706:                 thread = null;
1712:             if (Thread.interrupted())
1718:                     thread == null);
1729:         final boolean isLive() { return thread != null; }
1761:             q.thread = null;
1766:                     Thread.currentThread().interrupt();
1779:         if (Thread.interrupted())
1805:                 q.thread = null;
1918:      * @throws InterruptedException if the current thread was interrupted
1935:      * @throws InterruptedException if the current thread was interrupted
2421:      * parallel thread, or else an Executor using one thread per async
2423:      * an Executor that provides at least one independent thread.
2661:                 Thread t = new Thread(r);
51:  * <p>When two or more threads attempt to
195:      * linked). Multiple threads can call postComplete, which
203:      * that wake up waiting threads.  The mechanics are similar to
213:      * threads nulling out fields.  We also try to unlink fired
216:      * volatile because they are only visible to other threads upon
403:         ForkJoinPool.commonPool() : new ThreadPerTaskExecutor();
1743:                 if (ThreadLocalRandom.nextSecondarySeed() >= 0)
2668:         static final ScheduledThreadPoolExecutor delayer;
2670:             (delayer = new ScheduledThreadPoolExecutor(
2671:                 1, new DaemonThreadFactory())).
github.com/google/guava:guava/src/com/google/common/util/concurrent/AbstractFuture.java: [ master, ]
181:     volatile @Nullable Thread thread;
1178:     abstract void putThread(Waiter waiter, Thread newValue);
1248:     void putThread(Waiter waiter, Thread newValue) {
1298:     void putThread(Waiter waiter, Thread newValue) {
1331:     void putThread(Waiter waiter, Thread newValue) {
1204:     static final long WAITER_THREAD_OFFSET;
1278:     final AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater;
147:                 newUpdater(Waiter.class, Thread.class, "thread"),
192:       ATOMIC_HELPER.putThread(this, Thread.currentThread());
203:       // unpark even though the thread has already removed itself from the list. But even if we did
205:       Thread w = thread;
207:         thread = null;
219:    *   <li>This is only called when a waiting thread times out or is interrupted. Both of which
225:     node.thread = null; // mark as 'deleted'
236:         if (curr.thread != null) { // we aren't unlinking this node, update pred.
240:           if (pred.thread == null) { // We raced with another node that unlinked pred. Restart.
374:   //   have observed 12 micros on 64 bit linux systems to wake up a parked thread). So if the
391:    * current thread is interrupted during the call, even if the value is already available.
403:     if (Thread.interrupted()) {
423:               if (Thread.interrupted()) {
438:                 // Remove the waiter, one way or another we are done parking this thread.
458:       if (Thread.interrupted()) {
502:    * current thread is interrupted during the call, even if the value is already available.
509:     if (Thread.interrupted()) {
526:             if (Thread.interrupted()) {
918:         Thread.currentThread().interrupt();
1143:     // arbitrary cycles using a thread local but this should be a good enough solution (it is also
1177:     /** Non volatile write of the thread to the {@link Waiter#thread} field. */
1238:         WAITER_THREAD_OFFSET = unsafe.objectFieldOffset(Waiter.class.getDeclaredField("thread"));
1249:       UNSAFE.putObject(waiter, WAITER_THREAD_OFFSET, newValue);
1285:         AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater,
1332:       waiter.thread = newValue;
357:   /** All waiting threads. */
923:   /** Unblocks all threads and runs all listeners. */
1023:   /** Releases all threads in the {@link #waiters} list, and clears the list. */
1290:       this.waiterThreadUpdater = waiterThreadUpdater;
1299:       waiterThreadUpdater.lazySet(waiter, newValue);
github.com/angular/material-start:package-lock.json: [ master, ]
1624:             "needle": "^2.2.1",
1605:         "needle": {
github.com/google/guava:android/guava/src/com/google/common/util/concurrent/AbstractFuture.java: [ master, ]
181:     @NullableDecl volatile Thread thread;
1179:     abstract void putThread(Waiter waiter, Thread newValue);
1249:     void putThread(Waiter waiter, Thread newValue) {
1299:     void putThread(Waiter waiter, Thread newValue) {
1332:     void putThread(Waiter waiter, Thread newValue) {
1205:     static final long WAITER_THREAD_OFFSET;
1279:     final AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater;
147:                 newUpdater(Waiter.class, Thread.class, "thread"),
192:       ATOMIC_HELPER.putThread(this, Thread.currentThread());
203:       // unpark even though the thread has already removed itself from the list. But even if we did
205:       Thread w = thread;
207:         thread = null;
219:    *   <li>This is only called when a waiting thread times out or is interrupted. Both of which
225:     node.thread = null; // mark as 'deleted'
236:         if (curr.thread != null) { // we aren't unlinking this node, update pred.
240:           if (pred.thread == null) { // We raced with another node that unlinked pred. Restart.
374:   //   have observed 12 micros on 64 bit linux systems to wake up a parked thread). So if the
391:    * current thread is interrupted during the call, even if the value is already available.
403:     if (Thread.interrupted()) {
423:               if (Thread.interrupted()) {
438:                 // Remove the waiter, one way or another we are done parking this thread.
458:       if (Thread.interrupted()) {
502:    * current thread is interrupted during the call, even if the value is already available.
509:     if (Thread.interrupted()) {
526:             if (Thread.interrupted()) {
918:         Thread.currentThread().interrupt();
1144:     // arbitrary cycles using a thread local but this should be a good enough solution (it is also
1178:     /** Non volatile write of the thread to the {@link Waiter#thread} field. */
1239:         WAITER_THREAD_OFFSET = unsafe.objectFieldOffset(Waiter.class.getDeclaredField("thread"));
1250:       UNSAFE.putObject(waiter, WAITER_THREAD_OFFSET, newValue);
1286:         AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater,
1333:       waiter.thread = newValue;
357:   /** All waiting threads. */
923:   /** Unblocks all threads and runs all listeners. */
1023:   /** Releases all threads in the {@link #waiters} list, and clears the list. */
1291:       this.waiterThreadUpdater = waiterThreadUpdater;
1300:       waiterThreadUpdater.lazySet(waiter, newValue);
github.com/google/filament:third_party/xatlas/xatlas.cpp: [ master, ]
2463: 		std::thread thread;
2253: 	uint16_t thread_num_tries_on_idle = 16;   // number of tries before suspend the thread
2254: 	uint32_t thread_sleep_on_idle_in_microseconds = 5; // time spent waiting between tries
2466: 		TLS *thread_tls = nullptr;
2467: 		uint16_t thread_index = 0xFFFF;
2412: 	void wakeUpOneThread()
2629: 	void wakeUpOneThread() {}
2250: 	uint16_t num_threads = 16;        // num OS threads created 
2251: 	uint16_t max_running_threads = 0; // 0 --> will be set to max hardware concurrency
84: #define XA_MULTITHREADED 1
2355: 	static void CurrentThreadSleeps()
2361: 	static void CurrentThreadWakesUp()
2368: 	static void CurrentThreadBeforeLockResource(const void *resource_ptr, const char *name = nullptr)
2383: 	static void CurrentThreadAfterLockResource()
2422: 	std::atomic<uint32_t> m_activeThreads;
2477: 	uint16_t wakeUpThreads(uint16_t max_num_threads)
2548: 	static void WorkerThreadMain(Scheduler *schd, Scheduler::Worker *worker_data)
29: #include <thread>
2053: 			std::this_thread::yield();
2267: 			m_params.max_running_threads = static_cast<uint16_t>(std::thread::hardware_concurrency());
2276: 			m_workers[i].thread_index = i;
2280: 			m_workers[i].thread = std::thread(WorkerThreadMain, this, &m_workers[i]);
2297: 				m_workers[i].thread.join();
2340: 	void waitFor(Sync s) //< suspend current thread 
2360: 	// call this again to notify the thread is again running
2367: 	// scheduler to wakeup another thread as a worker.
2370: 		// if the lock might work, wake up one thread to replace this one
2380: 	// used to notify the scheduler that this thread can continue working.
2381: 	// If success is true, the lock was successful, false if the thread was not
2385: 		// mark this thread as active (so eventually one thread will step down)
2408: 		static thread_local TLS tls;
2434: 		explicit WaitFor() : owner(std::this_thread::get_id()), ready(false) {}
2438: 			XA_DEBUG_ASSERT(std::this_thread::get_id() == owner);
2446: 			if (owner != std::this_thread::get_id()) {
2455: 		std::thread::id const owner;
2464: 		// setted by the thread when is sleep
2486: 				// will take the thread as awake before the thread actually is again working
2550: 		const uint16_t id = worker_data->thread_index;
2553: 		worker_data->thread_tls = local_storage;
2554: 		auto const ttl_wait = schd->m_params.thread_sleep_on_idle_in_microseconds;
2555: 		auto const ttl_value = schd->m_params.thread_num_tries_on_idle ? schd->m_params.thread_num_tries_on_idle : 1;
2579: 						if (ttl_wait) std::this_thread::sleep_for(std::chrono::microseconds(ttl_wait));
2591: 		worker_data->thread_tls = nullptr;
2228: 		// Avoid false sharing between threads
2266: 		if (m_params.max_running_threads == 0)
2273: 		m_workers = static_cast<Worker*>(XA_ALLOC_ARRAY(Worker, m_params.num_threads));
2274: 		for(uint16_t i = 0; i < m_params.num_threads; ++i) {
2279: 		for(uint16_t i = 0; i < m_params.num_threads; ++i) {
2293: 			for(uint16_t i = 0; i < m_params.num_threads; ++i) {
2294: 				wakeUpThreads(m_params.num_threads);
2296: 			for(uint16_t i = 0; i < m_params.num_threads; ++i) {
2314: 		wakeUpOneThread();
2336: 			wakeUpOneThread();
2374: 			d->scheduler->wakeUpOneThread();
2416: 			if ((active >= m_params.max_running_threads) || wakeUpThreads(1))
2480: 		for(uint32_t i = 0; (i < m_params.num_threads) && (total_woken_up < max_num_threads); ++i) {
2485: 				// Add one to the total active threads, for later substracting it, this
2533: 					schd->wakeUpOneThread();
2563: 					current_num > schd->m_params.max_running_threads) {
83: #ifndef XA_MULTITHREADED
2257: #if XA_MULTITHREADED
2261: 	Scheduler(const SchedulerParams &_params = SchedulerParams()) : m_activeThreads(0)
2278: 		XA_DEBUG_ASSERT(m_activeThreads.load() == 0);
2305: 			XA_DEBUG_ASSERT(m_activeThreads.load() == 0);
2348: 			CurrentThreadSleeps(); 
2350: 			CurrentThreadWakesUp(); 
2357: 		CurrentThreadBeforeLockResource(nullptr);
2363: 		CurrentThreadAfterLockResource();
2373: 			d->scheduler->m_activeThreads.fetch_sub(1);
2379: 	// Call this method after calling CurrentThreadBeforeLockResource, this will be
2388: 			d->scheduler->m_activeThreads.fetch_add(1);
2415: 			uint32_t active = m_activeThreads.load();
2487: 				m_activeThreads.fetch_add(1);
2490: 		m_activeThreads.fetch_sub(total_woken_up);
2556: 		schd->m_activeThreads.fetch_add(1);
2559: 				auto current_num = schd->m_activeThreads.fetch_sub(1);
2570: 				schd->m_activeThreads.fetch_add(1);
github.com/apache/beam:sdks/go/pkg/beam/model/fnexecution_v1/beam_fn_api.pb.go: [ master, ]
3188: 	Thread               string   `protobuf:"bytes,8,opt,name=thread,proto3" json:"thread,omitempty"`
3268: func (m *LogEntry) GetThread() string {
3187: 	// (Optional) The name of the thread this log statement is associated with.
3270: 		return m.Thread
github.com/google/binnavi:debug/client/windynamorio/drdebug.proto: [ master, ]
347:   optional uint64 thread  = 5; // required
54:     SUSPEND_THREAD        = 9;
55:     RESUME_THREAD         = 10;
75:   repeated uint64 thread_id = 2;
185:     UNKNOWN_THREAD             = 12;
232:   repeated uint64 thread_id = 1;
306:     THREAD_CREATED   = 2;
307:     THREAD_EXITED    = 3;
318:   optional ThreadCreatedInfo   thread_created_info   = 3;
319:   optional ThreadExitedInfo    thread_exited_info    = 4;
330:   optional uint64 thread_id = 3; // required
334:   optional uint64 thread_id = 1; // required
338:   optional uint64 thread_id = 1; // required
357:   optional uint64 thread_id    = 3; // required
365:   optional uint64 thread_id = 1; // required
333: message ThreadCreatedInfo {
337: message ThreadExitedInfo {
84:   optional SuspendThreadArgs       suspend_thread_args        = 9;
85:   optional ResumeThreadArgs        resume_thread_args         = 10;
206:   optional SuspendThreadResult       suspend_thread_result        = 9;
207:   optional ResumeThreadResult        resume_thread_result         = 10;
53:     LIST_THREADS          = 8;
83:   optional ListThreadsArgs         list_threads_args          = 8;
205:   optional ListThreadsResult         list_threads_result          = 8;
118: message ListThreadsArgs {
121: message SuspendThreadArgs {
124: message ResumeThreadArgs {
231: message ListThreadsResult {
235: message SuspendThreadResult {
238: message ResumeThreadResult {
52:     // thread control
74:   //       not all commands could be executed thread-locally (like write memory)
186:     // Someone tried to resume already running thread.
72:   // execute the command only on those threads
github.com/chromium/chromium:sandbox/win/src/nt_internals.h: [ master, ]
814:   HANDLE thread;
42: #define CURRENT_THREAD ((HANDLE)-2)
270:   PVOID UniqueThread;
286:   ThreadBasicInformation,
287:   ThreadTimes,
288:   ThreadPriority,
289:   ThreadBasePriority,
290:   ThreadAffinityMask,
291:   ThreadImpersonationToken,
292:   ThreadDescriptorTableEntry,
293:   ThreadEnableAlignmentFaultFixup,
294:   ThreadEventPair,
295:   ThreadQuerySetWin32StartAddress,
296:   ThreadZeroTlsCell,
297:   ThreadPerformanceCount,
298:   ThreadAmILastThread,
299:   ThreadIdealProcessor,
300:   ThreadPriorityBoost,
301:   ThreadSetTlsArrayAddress,
302:   ThreadIsIoPending,
303:   ThreadHideFromDebugger
285: typedef enum _NT_THREAD_INFORMATION_CLASS {
304: } NT_THREAD_INFORMATION_CLASS,
305:     *PNT_THREAD_INFORMATION_CLASS;
273: typedef NTSTATUS(WINAPI* NtOpenThreadFunction)(OUT PHANDLE ThreadHandle,
307: typedef NTSTATUS(WINAPI* NtSetInformationThreadFunction)(
377: typedef NTSTATUS(WINAPI* NtOpenThreadTokenFunction)(IN HANDLE ThreadHandle,
383: typedef NTSTATUS(WINAPI* NtOpenThreadTokenExFunction)(IN HANDLE ThreadHandle,
408: typedef NTSTATUS(WINAPI* RtlCreateUserThreadFunction)(
266: // Process and Thread
309:     IN NT_THREAD_INFORMATION_CLASS ThreadInformationClass,
417:     OUT PHANDLE Thread,
308:     IN HANDLE ThreadHandle,
310:     IN PVOID ThreadInformation,
311:     IN ULONG ThreadInformationLength);
410:     IN PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
415:     IN LPTHREAD_START_ROUTINE StartAddress,
github.com/google/binnavi:debug/client/defs.hpp: [ master, ]
232: struct Thread {
247:   Thread(unsigned int tid, ThreadState state)
136: enum ThreadState {
264:   typedef std::function<bool(const Thread&)> ThreadComparator;
586:   std::vector<Thread> threads;
589:   void addThread(const Thread& thread) {
158:   dbgevt_thread_created,
161:   dbgevt_thread_closed,
266:   static ThreadComparator MakeThreadIdComparator(int tid) {
593:   std::vector<Thread> getThreads() const {
135: // Identifies the state of a thread
137:   // Thread is running
140:   // Thread is suspended
157:   // A new thread was created in the target process
160:   // An existing thread was closed in the target process
230:  * Describes a thread of the target process
233:   //  The thread ID of the thread
236:   // The state of the thread
242:    * Creates a new Thread object
244:    * @param tid The thread ID of the thread
245:    * @param state The state of the thread
252:   bool operator==(const Thread& rhs) const {
256:   bool operator<(const Thread& rhs) const {
261:    * Returns a function which matches the thread with a given id
267:     return [tid](const Thread& t)->bool {return t.tid == tid; };
414:   // Thread ID of the thread where the exception happened
590:     threads.push_back(thread);
717:       std::vector<Thread> threads = registers.getThreads();
719:       for (std::vector<Thread>::iterator Iter = threads.begin();
721:         Thread t = *Iter;
237:   ThreadState state;
594:     return threads;
720:           Iter != threads.end(); ++Iter) {
github.com/google/gapid:gapis/service/service.proto: [ master, ]
892: message Thread {
78: message Threads {
79:   repeated path.Thread list = 1;
101:     Thread thread = 18;
891: // Thread represents a single thread in the capture.
102:     Threads threads = 19;
github.com/libgit2/objective-git:External/libgit2/src/pack-objects.c: [ master, ]
1110: 	git_thread thread;
1109: struct thread_params {
1127: static void *threaded_find_deltas(void *arg)
183: unsigned int git_packbuilder_set_threads(git_packbuilder *pb, unsigned int n)
15: #include "thread-utils.h"
155: 	pb->nr_threads = 1; /* do not spawn any thread by default */
1129: 	struct thread_params *me = arg;
1143: 			git_error_set(GIT_ERROR_THREAD, "unable to lock packfile condition mutex");
1152: 		 * condition because the main thread may have set it to 1
1155: 		 * was initialized to 0 before this thread was spawned
1168: 	struct thread_params *p;
1219: 		ret = git_thread_create(&p[i].thread,
1222: 			git_error_set(GIT_ERROR_THREAD, "unable to create thread");
1229: 	 * Now let's wait for work completion.  Each time a thread is done
1231: 	 * thread with the largest number of unprocessed objects and give
1232: 	 * it to that newly idle thread.  This ensure good load balancing
1237: 		struct thread_params *target = NULL;
1238: 		struct thread_params *victim = NULL;
1241: 		/* Start by locating a thread that has transitioned its
1256: 		 * a thread to receive more work. We still need to locate a
1257: 		 * thread from which to steal work (the victim). */
1291: 			git_error_set(GIT_ERROR_THREAD, "unable to lock packfile condition mutex");
1301: 			git_thread_join(&target->thread, NULL);
50: #ifdef GIT_THREADS
62: #endif /* GIT_THREADS */
163: #ifdef GIT_THREADS
187: #ifdef GIT_THREADS
188: 	pb->nr_threads = n;
191: 	assert(1 == pb->nr_threads);
194: 	return pb->nr_threads;
1033: 		 * it anyway, and doing it here while we're threaded will
1034: 		 * save a lot of time in the non threaded write phase,
1107: #ifdef GIT_THREADS
1170: 	int ret, active_threads = 0;
1172: 	if (!pb->nr_threads)
1173: 		pb->nr_threads = git_online_cpus();
1175: 	if (pb->nr_threads <= 1) {
1180: 	p = git__mallocarray(pb->nr_threads, sizeof(*p));
1183: 	/* Partition the work among the threads */
1184: 	for (i = 0; i < pb->nr_threads; ++i) {
1185: 		size_t sub_size = list_size / (pb->nr_threads - i);
1188: 		if (sub_size < 2*window && i+1 < pb->nr_threads)
1211: 	/* Start work threads */
1212: 	for (i = 0; i < pb->nr_threads; ++i) {
1220: 					threaded_find_deltas, &p[i]);
1225: 		active_threads++;
1236: 	while (active_threads) {
1247: 			for (i = 0; !target && i < pb->nr_threads; i++)
1258: 		for (i = 0; i < pb->nr_threads; i++)
1304: 			active_threads--;
1773: #ifdef GIT_THREADS
github.com/firebase/firebase-ios-sdk:Firebase/Messaging/Protos/GtalkCore.pbobjc.h: [ master, ]
809: @property(nonatomic, readwrite, copy, null_resettable) NSString *thread;
811: @property(nonatomic, readwrite) BOOL hasThread;
761:   GtalkMessageStanza_FieldNumber_Thread = 8,
810: /** Test to see if @c thread has been set. */
github.com/firebase/firebase-android-sdk:firebase-crashlytics/src/androidTest/java/com/google/firebase/crashlytics/device/session/Crashlytics.java: [ master, ]
9211:           public static final class Thread extends com.google.protobuf.GeneratedMessage
9214:             private Thread(Builder builder) {
9218:             private Thread(boolean noInit) {}
225:     IN_CRASHED_THREAD(2, 4),
9143:           public interface ThreadOrBuilder extends com.google.protobuf.MessageOrBuilder {
15726:           public static final int THREADS_FIELD_NUMBER = 1;
15730:               threads_;
16412:                 threads_ = java.util.Collections.emptyList();
16431:                 threadsBuilder_;
234:     public static final int IN_CRASHED_THREAD_VALUE = 4;
26002:       internal_static_Crashlytics_Session_Event_Application_Execution_Thread_descriptor;
26004:       internal_static_Crashlytics_Session_Event_Application_Execution_Thread_fieldAccessorTable;
26006:       internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_descriptor;
26008:       internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_fieldAccessorTable;
26010:       internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_descriptor;
26012:       internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_fieldAccessorTable;
9050:               getThreadsList();
9054:               getThreads(int index);
9056:           int getThreadsCount();
9062:               getThreadsOrBuilderList();
9066:               getThreadsOrBuilder(int index);
15735:               getThreadsList() {
15743:               getThreadsOrBuilderList() {
15747:           public int getThreadsCount() {
15753:               getThreads(int index) {
15759:               getThreadsOrBuilder(int index) {
16414:             private void ensureThreadsIsMutable() {
16436:                 getThreadsList() {
16444:             public int getThreadsCount() {
16454:                 getThreads(int index) {
16462:             public Builder setThreads(
16480:             public Builder setThreads(
16495:             public Builder addThreads(
16512:             public Builder addThreads(
16530:             public Builder addThreads(
16544:             public Builder addThreads(
16559:             public Builder addAllThreads(
16575:             public Builder clearThreads() {
16586:             public Builder removeThreads(int index) {
16599:                 getThreadsBuilder(int index) {
16605:                 getThreadsOrBuilder(int index) {
16617:                 getThreadsOrBuilderList() {
16627:                 addThreadsBuilder() {
16636:                 addThreadsBuilder(int index) {
16647:                 getThreadsBuilderList() {
16658:                 getThreadsFieldBuilder() {
251:           return IN_CRASHED_THREAD;
293:       IN_CRASHED_THREAD,
9046:           // repeated .Crashlytics.Session.Event.Application.Execution.Thread threads = 1;
9049:                       .Application.Execution.Thread>
9053:                   .Execution.Thread
9155:             // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Frame frames = 3;
9158:                         .Application.Execution.Thread.Frame>
9162:                     .Execution.Thread.Frame
9170:                             .Application.Execution.Thread.FrameOrBuilder>
9174:                     .Execution.Thread.FrameOrBuilder
9177:             // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Register registers =
9181:                         .Application.Execution.Thread.Register>
9185:                     .Execution.Thread.Register
9193:                             .Application.Execution.Thread.RegisterOrBuilder>
9197:                     .Execution.Thread.RegisterOrBuilder
9213:             // Use Thread.newBuilder() to construct.
9220:             private static final Thread defaultInstance;
9222:             public static Thread getDefaultInstance() {
9226:             public Thread getDefaultInstanceForType() {
9232:                   .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_descriptor;
9238:                   .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_fieldAccessorTable;
9320:                     .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_descriptor;
9326:                     .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_fieldAccessorTable;
9677:                       .Application.Execution.Thread.Frame
9684:                       .Application.Execution.Thread.Frame
9693:                       .Application.Execution.Thread.Frame
9699:                       .Application.Execution.Thread.Frame
9707:                       .Application.Execution.Thread.Frame
9713:                       .Application.Execution.Thread.Frame
9722:                       .Application.Execution.Thread.Frame
9733:                       .Application.Execution.Thread.Frame
9747:                       .Application.Execution.Thread.Frame
9753:                       .Application.Execution.Thread.Frame
9771:                           .Application.Execution.Thread.Frame
9790:                       .Event.Application.Execution.Thread.FrameOrBuilder {
9793:                       .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_descriptor;
9799:                       .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_fieldAccessorTable;
9803: ...(14 bytes skipped)...  // com.google.firebase.crashlytics.device.session.Crashlytics.Session.Event.Application.Execution.Thread.Frame.newBuilder()
9854:                       .Application.Execution.Thread.Frame.getDescriptor();
9858:                         .Application.Execution.Thread.Frame
9861:                       .Application.Execution.Thread.Frame.getDefaultInstance();
9865:                         .Application.Execution.Thread.Frame
9868:                           .Application.Execution.Thread.Frame
9877:                         .Application.Execution.Thread.Frame
9880:                           .Application.Execution.Thread.Frame
9890:                         .Application.Execution.Thread.Frame
9893:                           .Application.Execution.Thread.Frame
9896:                               .Event.Application.Execution.Thread.Frame(this);
9952:                           .Application.Execution.Thread.Frame) {
9955:                                 .Application.Execution.Thread.Frame)
9965:                             .Application.Execution.Thread.Frame
9969:                           .Application.Execution.Thread.Frame.getDefaultInstance()) return this;
10450: ...(6 bytes skipped)...          // @@protoc_insertion_point(builder_scope:Crashlytics.Session.Event.Application.Execution.Thread.Frame)
10458: ...(2 bytes skipped)...            // @@protoc_insertion_point(class_scope:Crashlytics.Session.Event.Application.Execution.Thread.Frame)
10495:                     .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_descriptor;
10501:                     .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_fieldAccessorTable;
10612:                       .Application.Execution.Thread.Register
10619:                       .Application.Execution.Thread.Register
10628:                       .Application.Execution.Thread.Register
10634:                       .Application.Execution.Thread.Register
10642:                       .Application.Execution.Thread.Register
10648:                       .Application.Execution.Thread.Register
10657:                       .Application.Execution.Thread.Register
10668:                       .Application.Execution.Thread.Register
10682:                       .Application.Execution.Thread.Register
10688:                       .Application.Execution.Thread.Register
10706:                           .Application.Execution.Thread.Register
10725:                       .Event.Application.Execution.Thread.RegisterOrBuilder {
10728:                       .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_descriptor;
10734:                       .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_fieldAccessorTable;
10738: ...(14 bytes skipped)...  // com.google.firebase.crashlytics.device.session.Crashlytics.Session.Event.Application.Execution.Thread.Register.newBuilder()
10771:                       .Application.Execution.Thread.Register.getDescriptor();
10775:                         .Application.Execution.Thread.Register
10778:                       .Application.Execution.Thread.Register.getDefaultInstance();
10782:                         .Application.Execution.Thread.Register
10785:                           .Application.Execution.Thread.Register
10794:                         .Application.Execution.Thread.Register
10797:                           .Application.Execution.Thread.Register
10807:                         .Application.Execution.Thread.Register
10810:                           .Application.Execution.Thread.Register
10813:                               .Event.Application.Execution.Thread.Register(this);
10833:                           .Application.Execution.Thread.Register) {
10836:                                 .Application.Execution.Thread.Register)
10846:                             .Application.Execution.Thread.Register
10850:                           .Application.Execution.Thread.Register.getDefaultInstance()) return this;
10981: ...(6 bytes skipped)...          // @@protoc_insertion_point(builder_scope:Crashlytics.Session.Event.Application.Execution.Thread.Register)
10989: ...(2 bytes skipped)...            // @@protoc_insertion_point(class_scope:Crashlytics.Session.Event.Application.Execution.Thread.Register)
11039:             // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Frame frames = 3;
11043:                         .Application.Execution.Thread.Frame>
11048:                         .Application.Execution.Thread.Frame>
11056:                             .Application.Execution.Thread.FrameOrBuilder>
11066:                     .Application.Execution.Thread.Frame
11072:                     .Application.Execution.Thread.FrameOrBuilder
11077:             // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Register registers =
11082:                         .Application.Execution.Thread.Register>
11087:                         .Application.Execution.Thread.Register>
11095:                             .Application.Execution.Thread.RegisterOrBuilder>
11105:                     .Application.Execution.Thread.Register
11111:                     .Application.Execution.Thread.RegisterOrBuilder
11286:                     .Application.Execution.Thread
11293:                     .Application.Execution.Thread
11302:                     .Application.Execution.Thread
11308:                     .Application.Execution.Thread
11315:                     .Application.Execution.Thread
11321:                     .Application.Execution.Thread
11330:                     .Application.Execution.Thread
11341:                     .Application.Execution.Thread
11355:                     .Application.Execution.Thread
11361:                     .Application.Execution.Thread
11379:                         .Execution.Thread
11401:                     .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_descriptor;
11407:                     .internal_static_Crashlytics_Session_Event_Application_Execution_Thread_fieldAccessorTable;
11411: ...(12 bytes skipped)...  // com.google.firebase.crashlytics.device.session.Crashlytics.Session.Event.Application.Execution.Thread.newBuilder()
11463:                     .Application.Execution.Thread.getDescriptor();
11467:                       .Application.Execution.Thread
11470:                     .Application.Execution.Thread.getDefaultInstance();
11474:                       .Application.Execution.Thread
11477:                         .Execution.Thread
11486:                       .Application.Execution.Thread
11489:                         .Execution.Thread
11498:                       .Application.Execution.Thread
11501:                         .Execution.Thread
11504:                             .Application.Execution.Thread(this);
11550:                         .Application.Execution.Thread) {
11553:                               .Application.Execution.Thread)
11563:                           .Application.Execution.Thread
11567:                         .Application.Execution.Thread.getDefaultInstance()) return this;
11697:                                 .Application.Execution.Thread.Frame.Builder
11700:                                     .Event.Application.Execution.Thread.Frame.newBuilder();
11708:                                 .Application.Execution.Thread.Register.Builder
11711:                                     .Event.Application.Execution.Thread.Register.newBuilder();
11800:               // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Frame frames = 3;
11803:                           .Application.Execution.Thread.Frame>
11811:                               .Application.Execution.Thread.Frame>(frames_);
11818:                           .Application.Execution.Thread.Frame,
11820:                           .Application.Execution.Thread.Frame.Builder,
11822:                           .Application.Execution.Thread.FrameOrBuilder>
11827:                           .Application.Execution.Thread.Frame>
11845:                       .Application.Execution.Thread.Frame
11857:                           .Application.Execution.Thread.Frame
11875:                           .Application.Execution.Thread.Frame.Builder
11889:                           .Application.Execution.Thread.Frame
11907:                           .Application.Execution.Thread.Frame
11924:                           .Application.Execution.Thread.Frame.Builder
11939:                           .Application.Execution.Thread.Frame.Builder
11955:                                   .Event.Application.Execution.Thread.Frame>
11990:                       .Application.Execution.Thread.Frame.Builder
11996:                       .Application.Execution.Thread.FrameOrBuilder
12008:                               .Application.Execution.Thread.FrameOrBuilder>
12018:                       .Application.Execution.Thread.Frame.Builder
12023:                             .Application.Execution.Thread.Frame.getDefaultInstance());
12027:                       .Application.Execution.Thread.Frame.Builder
12033:                             .Application.Execution.Thread.Frame.getDefaultInstance());
12038:                           .Application.Execution.Thread.Frame.Builder>
12045:                           .Application.Execution.Thread.Frame,
12047:                           .Application.Execution.Thread.Frame.Builder,
12049:                           .Application.Execution.Thread.FrameOrBuilder>
12055:                               .Application.Execution.Thread.Frame,
12057:                               .Application.Execution.Thread.Frame.Builder,
12059:                               .Application.Execution.Thread.FrameOrBuilder>(
12069:               // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Register registers
12073:                           .Application.Execution.Thread.Register>
12081:                               .Application.Execution.Thread.Register>(registers_);
12088:                           .Application.Execution.Thread.Register,
12090:                           .Application.Execution.Thread.Register.Builder,
12092:                           .Application.Execution.Thread.RegisterOrBuilder>
12097:                           .Application.Execution.Thread.Register>
12115:                       .Application.Execution.Thread.Register
12127:                           .Application.Execution.Thread.Register
12145:                           .Application.Execution.Thread.Register.Builder
12159:                           .Application.Execution.Thread.Register
12177:                           .Application.Execution.Thread.Register
12194:                           .Application.Execution.Thread.Register.Builder
12209:                           .Application.Execution.Thread.Register.Builder
12225:                                   .Event.Application.Execution.Thread.Register>
12260:                       .Application.Execution.Thread.Register.Builder
12266:                       .Application.Execution.Thread.RegisterOrBuilder
12278:                               .Application.Execution.Thread.RegisterOrBuilder>
12288:                       .Application.Execution.Thread.Register.Builder
12293:                             .Application.Execution.Thread.Register.getDefaultInstance());
12297:                       .Application.Execution.Thread.Register.Builder
12303:                             .Application.Execution.Thread.Register.getDefaultInstance());
12308:                           .Application.Execution.Thread.Register.Builder>
12315:                           .Application.Execution.Thread.Register,
12317:                           .Application.Execution.Thread.Register.Builder,
12319:                           .Application.Execution.Thread.RegisterOrBuilder>
12325:                               .Application.Execution.Thread.Register,
12327:                               .Application.Execution.Thread.Register.Builder,
12329:                               .Application.Execution.Thread.RegisterOrBuilder>(
12421: ...(4 bytes skipped)...          // @@protoc_insertion_point(builder_scope:Crashlytics.Session.Event.Application.Execution.Thread)
12425:               defaultInstance = new Thread(true);
12429: ...(0 bytes skipped)...            // @@protoc_insertion_point(class_scope:Crashlytics.Session.Event.Application.Execution.Thread)
12449:             // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Frame frames = 4;
12452:                         .Application.Execution.Thread.Frame>
12456:                     .Execution.Thread.Frame
12464:                             .Application.Execution.Thread.FrameOrBuilder>
12468:                     .Execution.Thread.FrameOrBuilder
12645:             // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Frame frames = 4;
12649:                         .Application.Execution.Thread.Frame>
12654:                         .Application.Execution.Thread.Frame>
12662:                             .Application.Execution.Thread.FrameOrBuilder>
12672:                     .Application.Execution.Thread.Frame
12678:                     .Application.Execution.Thread.FrameOrBuilder
13329:                                 .Application.Execution.Thread.Frame.Builder
13332:                                     .Event.Application.Execution.Thread.Frame.newBuilder();
13503:               // repeated .Crashlytics.Session.Event.Application.Execution.Thread.Frame frames = 4;
13506:                           .Application.Execution.Thread.Frame>
13514:                               .Application.Execution.Thread.Frame>(frames_);
13521:                           .Application.Execution.Thread.Frame,
13523:                           .Application.Execution.Thread.Frame.Builder,
13525:                           .Application.Execution.Thread.FrameOrBuilder>
13530:                           .Application.Execution.Thread.Frame>
13548:                       .Application.Execution.Thread.Frame
13560:                           .Application.Execution.Thread.Frame
13578:                           .Application.Execution.Thread.Frame.Builder
13592:                           .Application.Execution.Thread.Frame
13610:                           .Application.Execution.Thread.Frame
13627:                           .Application.Execution.Thread.Frame.Builder
13642:                           .Application.Execution.Thread.Frame.Builder
13658:                                   .Event.Application.Execution.Thread.Frame>
13693:                       .Application.Execution.Thread.Frame.Builder
13699:                       .Application.Execution.Thread.FrameOrBuilder
13711:                               .Application.Execution.Thread.FrameOrBuilder>
13721:                       .Application.Execution.Thread.Frame.Builder
13726:                             .Application.Execution.Thread.Frame.getDefaultInstance());
13730:                       .Application.Execution.Thread.Frame.Builder
13736:                             .Application.Execution.Thread.Frame.getDefaultInstance());
13741:                           .Application.Execution.Thread.Frame.Builder>
13748:                           .Application.Execution.Thread.Frame,
13750:                           .Application.Execution.Thread.Frame.Builder,
13752:                           .Application.Execution.Thread.FrameOrBuilder>
13758:                               .Application.Execution.Thread.Frame,
13760:                               .Application.Execution.Thread.Frame.Builder,
13762:                               .Application.Execution.Thread.FrameOrBuilder>(
15725:           // repeated .Crashlytics.Session.Event.Application.Execution.Thread threads = 1;
15729:                       .Application.Execution.Thread>
15734:                       .Application.Execution.Thread>
15752:                   .Application.Execution.Thread
16355:                               .Application.Execution.Thread.Builder
16358:                                   .Event.Application.Execution.Thread.newBuilder();
16408:             // repeated .Crashlytics.Session.Event.Application.Execution.Thread threads = 1;
16411:                         .Application.Execution.Thread>
16419:                             .Application.Execution.Thread>(threads_);
16426:                         .Application.Execution.Thread,
16428:                         .Application.Execution.Thread.Builder,
16435:                         .Application.Execution.Thread>
16453:                     .Application.Execution.Thread
16465:                         .Execution.Thread
16483:                         .Execution.Thread.Builder
16497:                         .Execution.Thread
16515:                         .Execution.Thread
16532:                         .Execution.Thread.Builder
16547:                         .Execution.Thread.Builder
16563:                                 .Application.Execution.Thread>
16598:                     .Application.Execution.Thread.Builder
16626:                     .Application.Execution.Thread.Builder
16631:                           .Application.Execution.Thread.getDefaultInstance());
16635:                     .Application.Execution.Thread.Builder
16641:                           .Application.Execution.Thread.getDefaultInstance());
16646:                         .Application.Execution.Thread.Builder>
16653:                         .Application.Execution.Thread,
16655:                         .Application.Execution.Thread.Builder,
16663:                             .Application.Execution.Thread,
16665:                             .Application.Execution.Thread.Builder,
26112:           + "ecution.Thread\022M\n\texception\030\002 \001(\0132:.Cras"
26118:           + "yImage\032\215\004\n\006Thread\022\014\n\004name\030\001 \001(\t\022\022\n\nimpor"
26123:           + "Thread.Register\022\026\n\016alternate_name\030\005 \001(\t\022",
26134:       "lication.Execution.Thread.Frame\0227\n\021custo"
26169:           + "HED_THREAD\020\004\022\030\n\024LIKELY_LEAD_TO_CRASH\020\010\022\020"
26392:             internal_static_Crashlytics_Session_Event_Application_Execution_Thread_descriptor =
26396:             internal_static_Crashlytics_Session_Event_Application_Execution_Thread_fieldAccessorTable =
26398:                     internal_static_Crashlytics_Session_Event_Application_Execution_Thread_descriptor,
26408:                         .Application.Execution.Thread.class,
26410:                         .Application.Execution.Thread.Builder.class);
26411:             internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_descriptor =
26412:                 internal_static_Crashlytics_Session_Event_Application_Execution_Thread_descriptor
26415:             internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_fieldAccessorTable =
26417:                     internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Frame_descriptor,
26432:                         .Application.Execution.Thread.Frame.class,
26434:                         .Application.Execution.Thread.Frame.Builder.class);
26435:             internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_descriptor =
26436:                 internal_static_Crashlytics_Session_Event_Application_Execution_Thread_descriptor
26439:             internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_fieldAccessorTable =
26441:                     internal_static_Crashlytics_Session_Event_Application_Execution_Thread_Register_descriptor,
26446:                         .Application.Execution.Thread.Register.class,
26448:                         .Application.Execution.Thread.Register.Builder.class);
9061:                           .Application.Execution.ThreadOrBuilder>
9065:                   .Execution.ThreadOrBuilder
9212:               implements ThreadOrBuilder {
11398:                     .Application.Execution.ThreadOrBuilder {
15736:             return threads_;
15742:                           .Application.Execution.ThreadOrBuilder>
15744:             return threads_;
15748:             return threads_.size();
15754:             return threads_.get(index);
15758:                   .Application.Execution.ThreadOrBuilder
15760:             return threads_.get(index);
15846:             threads_ = java.util.Collections.emptyList();
15895:             for (int i = 0; i < threads_.size(); i++) {
15896:               output.writeMessage(1, threads_.get(i));
15917:             for (int i = 0; i < threads_.size(); i++) {
15918:               size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, threads_.get(i));
16092:               if (threadsBuilder_ == null) {
16093:                 threads_ = java.util.Collections.emptyList();
16096:                 threadsBuilder_.clear();
16173:               if (threadsBuilder_ == null) {
16175:                   threads_ = java.util.Collections.unmodifiableList(threads_);
16178:                 result.threads_ = threads_;
16180:                 result.threads_ = threadsBuilder_.build();
16234:               if (threadsBuilder_ == null) {
16235:                 if (!other.threads_.isEmpty()) {
16236:                   if (threads_.isEmpty()) {
16237:                     threads_ = other.threads_;
16241:                     threads_.addAll(other.threads_);
16246:                 if (!other.threads_.isEmpty()) {
16247:                   if (threadsBuilder_.isEmpty()) {
16248:                     threadsBuilder_.dispose();
16249:                     threadsBuilder_ = null;
16250:                     threads_ = other.threads_;
16252:                     threadsBuilder_ =
16257:                     threadsBuilder_.addAllMessages(other.threads_);
16416:                 threads_ =
16430:                         .Application.Execution.ThreadOrBuilder>
16437:               if (threadsBuilder_ == null) {
16438:                 return java.util.Collections.unmodifiableList(threads_);
16440:                 return threadsBuilder_.getMessageList();
16445:               if (threadsBuilder_ == null) {
16446:                 return threads_.size();
16448:                 return threadsBuilder_.getCount();
16455:               if (threadsBuilder_ == null) {
16456:                 return threads_.get(index);
16458:                 return threadsBuilder_.getMessage(index);
16467:               if (threadsBuilder_ == null) {
16472:                 threads_.set(index, value);
16475:                 threadsBuilder_.setMessage(index, value);
16485:               if (threadsBuilder_ == null) {
16487:                 threads_.set(index, builderForValue.build());
16490:                 threadsBuilder_.setMessage(index, builderForValue.build());
16499:               if (threadsBuilder_ == null) {
16504:                 threads_.add(value);
16507:                 threadsBuilder_.addMessage(value);
16517:               if (threadsBuilder_ == null) {
16522:                 threads_.add(index, value);
16525:                 threadsBuilder_.addMessage(index, value);
16534:               if (threadsBuilder_ == null) {
16536:                 threads_.add(builderForValue.build());
16539:                 threadsBuilder_.addMessage(builderForValue.build());
16549:               if (threadsBuilder_ == null) {
16551:                 threads_.add(index, builderForValue.build());
16554:                 threadsBuilder_.addMessage(index, builderForValue.build());
16565:               if (threadsBuilder_ == null) {
16567:                 super.addAll(values, threads_);
16570:                 threadsBuilder_.addAllMessages(values);
16576:               if (threadsBuilder_ == null) {
16577:                 threads_ = java.util.Collections.emptyList();
16581:                 threadsBuilder_.clear();
16587:               if (threadsBuilder_ == null) {
16589:                 threads_.remove(index);
16592:                 threadsBuilder_.remove(index);
16604:                     .Application.Execution.ThreadOrBuilder
16606:               if (threadsBuilder_ == null) {
16607:                 return threads_.get(index);
16609:                 return threadsBuilder_.getMessageOrBuilder(index);
16616:                             .Application.Execution.ThreadOrBuilder>
16618:               if (threadsBuilder_ != null) {
16619:                 return threadsBuilder_.getMessageOrBuilderList();
16621:                 return java.util.Collections.unmodifiableList(threads_);
16657:                         .Application.Execution.ThreadOrBuilder>
16659:               if (threadsBuilder_ == null) {
16660:                 threadsBuilder_ =
16667:                             .Application.Execution.ThreadOrBuilder>(
16668:                         threads_,
16672:                 threads_ = null;
16674:               return threadsBuilder_;
26110:           + "\030\004 \001(\r\032\312\n\n\tExecution\022H\n\007threads\030\001 \003(\01327."
26386:                       "Threads", "Exception", "Signal", "Binaries",
15866:             for (int i = 0; i < getThreadsCount(); i++) {
15867:               if (!getThreads(i).isInitialized()) {
16079:                 getThreadsFieldBuilder();
16240:                     ensureThreadsIsMutable();
16254:                             ? getThreadsFieldBuilder()
16303:               for (int i = 0; i < getThreadsCount(); i++) {
16304:                 if (!getThreads(i).isInitialized()) {
16360:                       addThreads(subBuilder.buildPartial());
16471:                 ensureThreadsIsMutable();
16486:                 ensureThreadsIsMutable();
16503:                 ensureThreadsIsMutable();
16521:                 ensureThreadsIsMutable();
16535:                 ensureThreadsIsMutable();
16550:                 ensureThreadsIsMutable();
16566:                 ensureThreadsIsMutable();
16588:                 ensureThreadsIsMutable();
16600:               return getThreadsFieldBuilder().getBuilder(index);
16628:               return getThreadsFieldBuilder()
16637:               return getThreadsFieldBuilder()
16648:               return getThreadsFieldBuilder().getBuilderList();
github.com/apache/httpcomponents-client:httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java: [ master, ]
854:         private final Thread thread;
214:     private ThreadFactory threadFactory;
429:     public final H2AsyncClientBuilder setThreadFactory(final ThreadFactory threadFactory) {
550:      * connection pool using a background thread.
553:      * in order to stop and release the background thread.
857:             this.thread = new DefaultThreadFactory("idle-connection-evictor", true).newThread(new Runnable() {
861:                         while (!Thread.currentThread().isInterrupted()) {
866:                         Thread.currentThread().interrupt();
875:             thread.start();
879:             thread.interrupt();
39: import java.util.concurrent.ThreadFactory;
427:      * Assigns {@link ThreadFactory} instance.
430:         this.threadFactory = threadFactory;
720:                 threadFactory != null ? threadFactory : new DefaultThreadFactory("httpclient-dispatch", true),
832:                 threadFactory != null ? threadFactory : new DefaultThreadFactory("httpclient-main", true),
77: import org.apache.hc.core5.concurrent.DefaultThreadFactory;
chromium.googlesource.com/chromium/src/sandbox:win/src/nt_internals.h: [ master, ] Duplicate result
android.googlesource.com/platform/external/opencv3:samples/gpu/stereo_multi.cpp: [ master, ]
31: class Thread
53:     Thread(void (*func)(void* userData), void* userData)
78: class Thread
99:     Thread(void (*func)(void* userData), void* userData)
49:     HANDLE thread_;
67:     ~Thread()
107:     ~Thread()
50:     DWORD threadId_;
95:     pthread_t thread_;
167: class StereoMultiGpuThread
196: StereoMultiGpuThread::StereoMultiGpuThread()
205: StereoMultiGpuThread::~StereoMultiGpuThread()
39:     static DWORD WINAPI WinThreadFunction(LPVOID lpParam)
86:     static void* PThreadFunction(void* lpParam)
27: // Thread
58:         thread_ = CreateThread(
61:             WinThreadFunction,      // thread function name
62:             &userData_,             // argument to thread function
64:             &threadId_);            // returns the thread identifier
69:         CloseHandle(thread_);
74:         WaitForSingleObject(thread_, INFINITE);
104:         pthread_create(&thread_, NULL, PThreadFunction, &userData_);
109:         pthread_detach(thread_);
114:         pthread_join(thread_, NULL);
249:     Thread thread0(launchGpuStereoAlg, &launchDatas[0]);
250:     Thread thread1(launchGpuStereoAlg, &launchDatas[1]);
252:     thread0.wait();
253:     thread1.wait();
273: // Run Stereo algorithm on two GPUs from single host thread using async API
426:     cout << "| Frame | GPU 0 ms | GPU 1 ms | Multi Thread ms | Multi Stream ms |" << endl;
8:     #include <pthread.h>
28: // OS-specific wrappers for multi-threading
164: // StereoMultiGpuThread
165: // Run Stereo algorithm on two GPUs using different host threads
170:     StereoMultiGpuThread();
171:     ~StereoMultiGpuThread();
220: void StereoMultiGpuThread::compute(const Mat& leftFrame, const Mat& rightFrame, Mat& disparity)
256: void StereoMultiGpuThread::launchGpuStereoAlg(void* userData)
410:     StereoMultiGpuThread multiThreadAlg;
415:     Mat disparityMultiThread;
465:                                disparityMultiThread);
484:         resize(disparityMultiThread, disparityMultiThreadShow, Size(1024, 768), 0, 0, INTER_AREA);
489:         imshow("disparityMultiThread", disparityMultiThreadShow);
420:     Mat disparityMultiThreadShow;
464:         multiThreadAlg.compute(leftGrayFrame.createMatHeader(), rightGrayFrame.createMatHeader(),
468:         const double multiThreadTime = tm.getTimeMilli();
479:              << setw(15) << setprecision(1) << fixed << multiThreadTime << " | "
android.googlesource.com/platform/external/libchrome:base/debug/activity_tracker.h: [ master, ]
119:   } thread;
118:     int64_t thread_id;  // A unique identifier for a thread within a process.
279:     ACT_THREAD = 4 << 4,
594:     std::string thread_name;
604:     int64_t thread_id = 0;
751:   const PlatformThreadRef thread_id_;  // The thread this instance is bound to.
1208:   std::atomic<int> thread_tracker_count_;
1211:   ActivityTrackerMemoryAllocator thread_tracker_allocator_;
1212:   Lock thread_tracker_allocator_lock_;
160:   static ActivityData ForThread(const int64_t id) {
574: class BASE_EXPORT ThreadActivityTracker {
957:   ThreadActivityTracker* GetTrackerForCurrentThread() {
964:   ThreadActivityTracker* GetOrCreateTrackerForCurrentThread() {
1084:   class ThreadSafeUserData : public ActivityUserData {
280:     ACT_THREAD_START = ACT_THREAD,
281:     ACT_THREAD_JOIN,
1205:   ThreadLocalStorage::Slot this_thread_tracker_;
840:   class BASE_EXPORT ScopedThreadActivity
1076:     kMaxThreadCount = 100,
1077:     kCachedThreadMemories = 10,
1335: class BASE_EXPORT ScopedThreadJoinActivity
1339:   explicit ScopedThreadJoinActivity(const PlatformThreadHandle* thread)
36: #include "base/threading/platform_thread.h"
37: #include "base/threading/thread_local_storage.h"
162:     data.thread.thread_id = id;
184: // persistent memory allocator. Instances of this class are NOT thread-safe.
185: // Use from a single thread or protect access with a lock.
263:     // Task activities involve callbacks posted to a thread or thread-pool
278:     // Thread activities involve the life management of threads.
309:   // from a completely different thread though most activities will leave
345: // done by a thread by supporting key/value pairs of any type. This can provide
347: // global data. All updates must be done from the same thread though other
411:   // contents have been overwritten by another thread. The return value is
537:   // gone away (cleared by another thread/process), it will invalidate all the
565: // This class manages tracking a stack of activities for a single thread in
568: // thread is analyzing this data in real-time, atomic operations are used
578:   // This structure contains all the common information about the thread so
585:   // so that continued operation of the thread will not cause changes here.
592:     // The name of the thread as set when it was created. The name may be
599:     // The process and thread IDs. These values have no meaning other than
600:     // they uniquely identify a running process and a running thread within
601:     // that process.  Thread-IDs can be re-used across different processes
602:     // and both can be re-used after the process/thread exits.
606:     // The current stack of activities that are underway for this thread. It
635:     // The thread tracker to which this object reports. It can be null if
748:   // The ActivityTracker is thread bound, and will be invoked across all the
749:   // sequences that run on the thread. A ThreadChecker does not work here, as it
761: // The global tracker manages all the individual thread trackers. Memory for
762: // the thread trackers is taken from a PersistentMemoryAllocator which allows
837:   // This is a thin wrapper around the thread-tracker's ScopedActivity that
838:   // allows thread-safe access to data values. It is safe to use even if
854:     // Gets (or creates) a tracker for the current thread. If locking is not
857:     // the tracker for this thread has been created for other reasons, locks
858:     // will be tracked. The thread-tracker uses locks.
865:       // if code that runs late during thread destruction tries to use a
885:   // providing the given |stack_depth| to each thread tracker it manages. The
941:   // calling this. Tracking for the current thread will be automatically
953:   // Gets the thread's activity-tracker if it exists. This is inline for
954:   // performance reasons and it uses thread-local-storage (TLS) so that there
956:   // thread. Ownership remains with the global tracker.
958:     return reinterpret_cast<ThreadActivityTracker*>(this_thread_tracker_.Get());
961:   // Gets the thread's activity-tracker or creates one if none exists. This
971:   // Creates an activity-tracker for the current thread.
974:   // Releases the activity-tracker for the current thread (for testing only).
1039:   // Record field trial information. This call is thread-safe. In addition to
1050:   // Record exception information for the current thread.
1065:   // Updates to this are thread-safe.
1081:   // A wrapper around ActivityUserData that is thread-safe and thus can be used
1083:   // thread.
1145:   // A thin wrapper around the main thread-tracker that keeps additional
1154:     // The reference into persistent memory from which the thread-tracker's
1158:     // The physical address used for the thread-tracker's memory.
1166:   // providing the given |stack_depth| to each thread tracker it manages. The
1181:   // Releases the activity-tracker associcated with thread. It is called
1182:   // automatically when a thread is joined and thus there is nothing more to
1186:   // Does process-exit work. This can be run on any thread.
1204:   // The activity tracker for the currently executing thread.
1207:   // The number of thread trackers currently active.
1210:   // A caching memory allocator for thread-tracker objects.
1218:   // An object for holding arbitrary key value pairs with thread-safe access.
1239:   // the |background_task_runner_| if one is set or whatever thread reaped
1340:       : ScopedThreadJoinActivity(GetProgramCounter(), thread) {}
1344:                            const PlatformThreadHandle* thread);
9: // what all the various threads and processes are (or were) doing.
51: class ThreadActivityTracker;
159:   static ActivityData ForThread(const PlatformThreadHandle& handle);
348: // threads can read it concurrently if they create new objects using the same
624:     ScopedActivity(ThreadActivityTracker* tracker,
637:     ThreadActivityTracker* const tracker_;
646:   // A ThreadActivityTracker runs on top of memory that is managed externally.
649:   ThreadActivityTracker(void* base, size_t size);
650:   virtual ~ThreadActivityTracker();
738:   bool CalledOnValidThread();
757:   DISALLOW_COPY_AND_ASSIGN(ThreadActivityTracker);
841:       : public ThreadActivityTracker::ScopedActivity {
859:     static ThreadActivityTracker* GetOrCreateTracker(bool lock_allowed) {
867:       if (base::ThreadLocalStorage::HasBeenDestroyed())
871:         return global_tracker->GetOrCreateTrackerForCurrentThread();
873:         return global_tracker->GetTrackerForCurrentThread();
940:   // the global tracker completely. All tracked threads must exit before
965:     ThreadActivityTracker* tracker = GetTrackerForCurrentThread();
968:     return CreateTrackerForCurrentThread();
972:   ThreadActivityTracker* CreateTrackerForCurrentThread();
1074:     // The maximum number of threads that can be tracked within a process. If
1086:     ThreadSafeUserData(void* memory, size_t size, int64_t pid = 0);
1087:     ~ThreadSafeUserData() override;
1097:     DISALLOW_COPY_AND_ASSIGN(ThreadSafeUserData);
1146:   // information that the global tracker needs to handle joined threads.
1147:   class ManagedActivityTracker : public ThreadActivityTracker {
1196:   // The size (in bytes) of memory required by a ThreadActivityTracker to
1219:   ThreadSafeUserData process_data_;
45: class PlatformThreadHandle;
843:     ScopedThreadActivity(const void* program_counter,
848:     ~ScopedThreadActivity();
879:     DISALLOW_COPY_AND_ASSIGN(ScopedThreadActivity);
975:   void ReleaseTrackerForCurrentThreadForTesting();
1070:   friend class ScopedThreadActivity;
1249:     : public GlobalActivityTracker::ScopedThreadActivity {
1298:     : public GlobalActivityTracker::ScopedThreadActivity {
1310:     : public GlobalActivityTracker::ScopedThreadActivity {
1323:     : public GlobalActivityTracker::ScopedThreadActivity {
1336:     : public GlobalActivityTracker::ScopedThreadActivity {
1343:   ScopedThreadJoinActivity(const void* program_counter,
1345:   DISALLOW_COPY_AND_ASSIGN(ScopedThreadJoinActivity);
1351:     : public GlobalActivityTracker::ScopedThreadActivity {
android.googlesource.com/platform/external/lzma:CPP/7zip/UI/Common/Bench.cpp: [ master, ]
694:   NWindows::CThread thread[2];
1512:   NWindows::CThread Thread;
1563:   NWindows::CThread Thread;
799:   HRESULT CreateEncoderThread()
804:   HRESULT CreateDecoderThread(unsigned index, bool callbackMode
695:   UInt32 NumDecoderSubThreads;
764:   static THREAD_FUNC_DECL EncodeThreadFunction(void *param)
786:   static THREAD_FUNC_DECL DecodeThreadFunction(void *param)
1141: static const UInt32 kNumThreadsMax = (1 << 12);
1526: static THREAD_FUNC_DECL FreqThreadFunction(void *param)
1542: struct CFreqThreads
1545:   UInt32 NumThreads;
1547:   CFreqThreads(): Items(NULL), NumThreads(0) {}
1554:   ~CFreqThreads()
1586: static THREAD_FUNC_DECL CrcThreadFunction(void *param)
1600: struct CCrcThreads
1603:   UInt32 NumThreads;
1605:   CCrcThreads(): Items(NULL), NumThreads(0) {}
1612:   ~CCrcThreads()
1867: AString GetProcessThreadsInfo(const NSystem::CProcessAffinity &ti)
2419: static UInt32 GetNumThreadsNext(unsigned i, UInt32 numThreads)
37: #include "../../../Windows/Thread.h"
801:     return thread[0].Create(EncodeThreadFunction, this);
819:     return thread[index].Create(DecodeThreadFunction, &decoder);
1313:       encoders[i].thread[0].Wait();
1386:         encoder.thread[j].Wait();
1403:         if (::GetThreadTimes(encoders[i].thread[j], &creationTime, &exitTime, &kernelTime, &userTime) != 0)
1521:     Thread.Wait();
1522:     Thread.Close();
1581:     Thread.Wait();
1582:     Thread.Close();
2166:       RINOK(info.Thread.Create(FreqThreadFunction, &info));
2302:       RINOK(info.Thread.Create(CrcThreadFunction, &info));
441:     ::GetThreadTimes(::GetCurrentThread()
1301:       RINOK(encoder.CreateEncoderThread())
1364:         HRESULT res = encoder.CreateDecoderThread(j, (i == 0 && j == 0)
1427: static inline UInt64 GetLZMAUsage(bool multiThread, UInt32 dictionary)
1440:       (1 << 20) + (multiThread ? (6 << 20) : 0);
1934:     bool size_Defined, UInt64 size, const char *threadsString, UInt32 numThreads)
1953:   f.Print(threadsString);
2149:   CFreqThreads threads;
2152:     threads.Items = new CFreqInfo[numThreads];
2156:       CFreqInfo &info = threads.Items[i];
2165:       CFreqInfo &info = threads.Items[i];
2167:       threads.NumThreads++;
2169:     threads.WaitAll();
2172:       RINOK(threads.Items[i].CallbackRes);
2258:   CCrcThreads threads;
2261:     threads.Items = new CCrcInfo[numThreads];
2266:       CCrcInfo &info = threads.Items[i];
2301:       CCrcInfo &info = threads.Items[i];
2303:       threads.NumThreads++;
2305:     threads.WaitAll();
2308:       RINOK(threads.Items[i].Res);
2801:   NSystem::CProcessAffinity threadsInfo;
2802:   threadsInfo.InitST();
2806:   if (threadsInfo.Get() && threadsInfo.processAffinityMask != 0)