Found 119840 results in 14814 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
android.googlesource.com/trusty/lk/common:include/kernel/thread.h: [ master, ]
88: typedef struct thread {
46: #define THREAD_STATS 1
47: #define THREAD_STACK_HIGHWATER 1
48: #define THREAD_STACK_BOUNDS_CHECK 1
50: #define THREAD_STACK_PADDING_SIZE 256
54: enum thread_state {
55:     THREAD_SUSPENDED = 0,
56:     THREAD_READY,
57:     THREAD_RUNNING,
58:     THREAD_BLOCKED,
59:     THREAD_SLEEPING,
60:     THREAD_DEATH,
63: typedef int (*thread_start_routine)(void *arg);
66: enum thread_tls_list {
79: #define THREAD_FLAG_DETACHED                  (1U<<0)
80: #define THREAD_FLAG_FREE_STACK                (1U<<1)
81: #define THREAD_FLAG_FREE_STRUCT               (1U<<2)
82: #define THREAD_FLAG_REAL_TIME                 (1U<<3)
83: #define THREAD_FLAG_IDLE                      (1U<<4)
84: #define THREAD_FLAG_DEBUG_STACK_BOUNDS_CHECK  (1U<<5)
86: #define THREAD_MAGIC (0x74687264) // 'thrd'
90:     struct list_node thread_list_node;
129: } thread_t;
132: #define thread_curr_cpu(t) ((t)->curr_cpu)
133: #define thread_pinned_cpu(t) ((t)->pinned_cpu)
134: #define thread_set_curr_cpu(t,c) ((t)->curr_cpu = (c))
135: #define thread_set_pinned_cpu(t, c) ((t)->pinned_cpu = (c))
137: #define thread_curr_cpu(t) (0)
138: #define thread_pinned_cpu(t) (-1)
139: #define thread_set_curr_cpu(t,c) do {} while(0)
140: #define thread_set_pinned_cpu(t, c) do {} while(0)
173: static inline void thread_sleep(lk_time_t delay_ms) {
201: #define THREAD_LOCK(state) spin_lock_saved_state_t state; spin_lock_irqsave(&thread_lock, state)
202: #define THREAD_UNLOCK(state) spin_unlock_irqrestore(&thread_lock, state)
204: static inline bool thread_lock_held(void)
210: static inline __ALWAYS_INLINE uintptr_t thread_tls_get(thread_t *t, uint entry)
227: #define thread_tls_set(t,e,v) \
237: struct thread_stats {
255: #define THREAD_STATS_INC(name) do { thread_stats[arch_curr_cpu_num()].name++; } while(0)
259: #define THREAD_STATS_INC(name) do { } while (0)
24: #define __KERNEL_THREAD_H
220: static inline __ALWAYS_INLINE uintptr_t __thread_tls_set(thread_t *t,
23: #ifndef __KERNEL_THREAD_H
31: #include <arch/thread.h>
49: #ifndef THREAD_STACK_PADDING_SIZE
65: /* thread local storage */
95:     enum thread_state state;
111:     struct arch_thread arch;
118:     thread_start_routine entry;
125:     /* thread local storage */
143: /* thread priority */
161: void thread_init_early(void);
162: void thread_init(void);
163: void thread_become_idle(void) __NO_RETURN;
164: void thread_secondary_cpu_init_early(void);
165: void thread_secondary_cpu_entry(void) __NO_RETURN;
166: void thread_set_name(const char *name);
167: void thread_set_priority(int priority);
168: thread_t *thread_create(const char *name, thread_start_routine entry, void *arg, int priority, size_t stack_size);
169: 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);
170: status_t thread_resume(thread_t *);
171: void thread_exit(int retcode) __NO_RETURN;
172: void thread_sleep_ns(lk_time_ns_t delay_ns);
174:     thread_sleep_ns(delay_ms * 1000ULL * 1000);
176: status_t thread_detach(thread_t *t);
177: status_t thread_join(thread_t *t, int *retcode, lk_time_t timeout);
178: status_t thread_detach_and_resume(thread_t *t);
179: status_t thread_set_real_time(thread_t *t);
181: void dump_thread(thread_t *t);
182: void arch_dump_thread(thread_t *t);
186: void thread_yield(void); /* give up the cpu voluntarily */
187: void thread_preempt(void); /* get preempted (inserted into head of run queue) */
188: void thread_block(void); /* block on something and reschedule */
189: void thread_unblock(thread_t *t, bool resched); /* go back in the run queue */
192: enum handler_return thread_timer_tick(void);
194: /* the current thread */
195: thread_t *get_current_thread(void);
196: void set_current_thread(thread_t *);
199: extern spin_lock_t thread_lock;
206:     return spin_lock_held(&thread_lock);
209: /* thread local storage */
217:     return thread_tls_get(get_current_thread(), entry);
230:         __thread_tls_set(t, e, v); \
233: #define tls_set(e,v) thread_tls_set(get_current_thread(), e, v)
235: /* thread level statistics */
236: #if THREAD_STATS
253: extern struct thread_stats thread_stats[SMP_MAX_CPUS];
183: void dump_all_threads(void);
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:src/lib.rs: [ master, ]
766: 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/system/nfc:src/adaptation/NfcAdaptation.cc: [ master, ]
464: uint32_t NfcAdaptation::Thread(__attribute__((unused)) uint32_t arg) {
825: ThreadMutex::ThreadMutex() {
875: ThreadCondVar::ThreadCondVar() {
842: ThreadMutex::~ThreadMutex() { pthread_mutex_destroy(&mMutex); }
893: ThreadCondVar::~ThreadCondVar() { pthread_cond_destroy(&mCondVar); }
932: AutoThreadMutex::AutoThreadMutex(ThreadMutex& m) : mm(m) { mm.lock(); }
943: AutoThreadMutex::~AutoThreadMutex() { mm.unlock(); }
288:   // Android already logs thread_id, proc_id, timestamp, so disable those.
369:     GKI_create_task((TASKPTR)Thread, MMI_TASK, (int8_t*)"NFCA_THREAD", nullptr, 0,
431: ** Description: signal the CondVar to release the thread that is waiting
457: ** Function:    NfcAdaptation::Thread()
465:   const char* func = "NfcAdaptation::Thread";
61: ThreadMutex NfcAdaptation::sLock;
64: ThreadCondVar NfcAdaptation::mHalOpenCompletedEvent;
65: ThreadCondVar NfcAdaptation::mHalCloseCompletedEvent;
304:     // of a byte array is ambiguous and needlessly difficult to configure.
366:                   (pthread_cond_t*)nullptr, nullptr);
370:                     (pthread_cond_t*)nullptr, nullptr);
459: ** Description: Creates work threads
469:     ThreadCondVar CondVar;
472:                     (pthread_cond_t*)CondVar, (pthread_mutex_t*)CondVar);
818: ** Function:    ThreadMutex::ThreadMutex()
826:   pthread_mutexattr_t mutexAttr;
828:   pthread_mutexattr_init(&mutexAttr);
829:   pthread_mutex_init(&mMutex, &mutexAttr);
830:   pthread_mutexattr_destroy(&mutexAttr);
835: ** Function:    ThreadMutex::~ThreadMutex()
846: ** Function:    ThreadMutex::lock()
853: void ThreadMutex::lock() { pthread_mutex_lock(&mMutex); }
857: ** Function:    ThreadMutex::unblock()
864: void ThreadMutex::unlock() { pthread_mutex_unlock(&mMutex); }
868: ** Function:    ThreadCondVar::ThreadCondVar()
876:   pthread_condattr_t CondAttr;
878:   pthread_condattr_init(&CondAttr);
879:   pthread_cond_init(&mCondVar, &CondAttr);
881:   pthread_condattr_destroy(&CondAttr);
886: ** Function:    ThreadCondVar::~ThreadCondVar()
897: ** Function:    ThreadCondVar::wait()
904: void ThreadCondVar::wait() {
905:   pthread_cond_wait(&mCondVar, *this);
906:   pthread_mutex_unlock(*this);
911: ** Function:    ThreadCondVar::signal()
918: void ThreadCondVar::signal() {
920:   pthread_cond_signal(&mCondVar);
194:   AutoThreadMutex a(sLock);
368:     AutoThreadMutex guard(mCondVar);
389:   AutoThreadMutex a(sLock);
470:     AutoThreadMutex guard(CondVar);
919:   AutoThreadMutex a(*this);
925: ** Function:    AutoThreadMutex::AutoThreadMutex()
936: ** Function:    AutoThreadMutex::~AutoThreadMutex()
go.googlesource.com/debug:internal/core/thread.go: [ master, ]
8: type Thread struct {
7: // A Thread represents an operating system thread.
9: 	pid  uint64   // thread/process ID
15: func (t *Thread) Pid() uint64 {
19: // Regs returns the set of register values for the thread.
23: func (t *Thread) Regs() []uint64 {
27: func (t *Thread) PC() Address {
31: func (t *Thread) SP() Address {
github.com/apache/kafka:clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java: [ trunk, ]
325:     private final Thread thread;
1203:         private boolean threadShouldExit(long now, long curHardShutdownTimeMs) {
278:     static final String NETWORK_THREAD_PREFIX = "kafka-admin-client-thread";
276:      * Thread name prefix for admin client network thread
318:      * The runnable used in the service thread for this admin client.
323:      * The network service thread for this admin client.
329:      * and force the RPC thread to exit. If the admin client is not closing, this will be 0.
334:      * A factory which creates TimeoutProcessors for the RPC thread.
538:         String threadName = NETWORK_THREAD_PREFIX + " | " + clientId;
539:         this.thread = new KafkaThread(threadName, runnable, true);
547:         thread.start();
591:                 client.wakeup(); // Wake the thread, if it is blocked inside poll().
603:             log.debug("Waiting for the I/O thread to exit. Hard shutdown in {} ms.", deltaMs);
606:             // close() can be called by AdminClient thread when it invokes callback. That will
608:             if (Thread.currentThread() != thread) {
609:                 // Wait for the thread to be joined.
610:                 thread.join(waitTimeMs);
614:             log.debug("Interrupted while joining I/O thread", e);
615:             Thread.currentThread().interrupt();
901:          * Only accessed from this thread.
907:          * Only accessed from this thread.
913:          * Only accessed from this thread.
919:          * Only accessed from this thread.
925:          * This will be null only if the thread has shut down.
1205:                 log.trace("All work has been completed, and the I/O thread is now exiting.");
1209:                 log.info("Forcing a hard I/O thread shutdown. Requests in progress will be aborted.");
1218:             log.trace("Thread starting");
1227:                     numTimedOut += timeoutProcessor.handleTimeouts(newCalls, "The AdminClient thread has exited.");
1230:                 numTimedOut += timeoutProcessor.handleTimeouts(pendingCalls, "The AdminClient thread has exited.");
1233:                         "The AdminClient thread has exited.");
1239:                 log.debug("Exiting AdminClientRunnable thread.");
1249:                 // Check if the AdminClient thread should shut down.
1304:          * If the AdminClient thread has exited, this will fail. Otherwise, it will succeed (even
1328:                 client.wakeup(); // wake the thread if it is in poll()
1330:                 log.debug("The AdminClient thread has exited. Timing out {}.", call);
1331:                 call.fail(Long.MAX_VALUE, new TimeoutException("The AdminClient thread has exited."));
1346:                 call.fail(Long.MAX_VALUE, new TimeoutException("The AdminClient thread is not accepting new calls."));
209: import org.apache.kafka.common.utils.KafkaThread;
1251:                 if ((curHardShutdownTimeMs != INVALID_SHUTDOWN_TIME) && threadShouldExit(now, curHardShutdownTimeMs))
github.com/kubernetes/minikube:site/themes/docsy/userguide/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/kubernetes/minikube:site/package-lock.json: [ master, ]
1098:             "needle": "^2.2.1",
1079:         "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, ]
192:     volatile @Nullable Thread thread;
1188:     abstract void putThread(Waiter waiter, Thread newValue);
1258:     void putThread(Waiter waiter, Thread newValue) {
1308:     void putThread(Waiter waiter, Thread newValue) {
1341:     void putThread(Waiter waiter, Thread newValue) {
1214:     static final long WAITER_THREAD_OFFSET;
1288:     final AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater;
158:                 newUpdater(Waiter.class, Thread.class, "thread"),
203:       ATOMIC_HELPER.putThread(this, Thread.currentThread());
214:       // unpark even though the thread has already removed itself from the list. But even if we did
216:       Thread w = thread;
218:         thread = null;
230:    *   <li>This is only called when a waiting thread times out or is interrupted. Both of which
236:     node.thread = null; // mark as 'deleted'
247:         if (curr.thread != null) { // we aren't unlinking this node, update pred.
251:           if (pred.thread == null) { // We raced with another node that unlinked pred. Restart.
385:   //   have observed 12 micros on 64 bit linux systems to wake up a parked thread). So if the
402:    * current thread is interrupted during the call, even if the value is already available.
414:     if (Thread.interrupted()) {
434:               if (Thread.interrupted()) {
449:                 // Remove the waiter, one way or another we are done parking this thread.
469:       if (Thread.interrupted()) {
513:    * current thread is interrupted during the call, even if the value is already available.
520:     if (Thread.interrupted()) {
537:             if (Thread.interrupted()) {
929:         Thread.currentThread().interrupt();
1153:     // arbitrary cycles using a thread local but this should be a good enough solution (it is also
1187:     /** Non volatile write of the thread to the {@link Waiter#thread} field. */
1248:         WAITER_THREAD_OFFSET = unsafe.objectFieldOffset(Waiter.class.getDeclaredField("thread"));
1259:       UNSAFE.putObject(waiter, WAITER_THREAD_OFFSET, newValue);
1295:         AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater,
1342:       waiter.thread = newValue;
368:   /** All waiting threads. */
934:   /** Unblocks all threads and runs all listeners. */
1033:   /** Releases all threads in the {@link #waiters} list, and clears the list. */
1300:       this.waiterThreadUpdater = waiterThreadUpdater;
1309:       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, ]
192:     @NullableDecl volatile Thread thread;
1190:     abstract void putThread(Waiter waiter, Thread newValue);
1260:     void putThread(Waiter waiter, Thread newValue) {
1310:     void putThread(Waiter waiter, Thread newValue) {
1343:     void putThread(Waiter waiter, Thread newValue) {
1216:     static final long WAITER_THREAD_OFFSET;
1290:     final AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater;
158:                 newUpdater(Waiter.class, Thread.class, "thread"),
203:       ATOMIC_HELPER.putThread(this, Thread.currentThread());
214:       // unpark even though the thread has already removed itself from the list. But even if we did
216:       Thread w = thread;
218:         thread = null;
230:    *   <li>This is only called when a waiting thread times out or is interrupted. Both of which
236:     node.thread = null; // mark as 'deleted'
247:         if (curr.thread != null) { // we aren't unlinking this node, update pred.
251:           if (pred.thread == null) { // We raced with another node that unlinked pred. Restart.
385:   //   have observed 12 micros on 64 bit linux systems to wake up a parked thread). So if the
402:    * current thread is interrupted during the call, even if the value is already available.
414:     if (Thread.interrupted()) {
434:               if (Thread.interrupted()) {
449:                 // Remove the waiter, one way or another we are done parking this thread.
469:       if (Thread.interrupted()) {
513:    * current thread is interrupted during the call, even if the value is already available.
520:     if (Thread.interrupted()) {
537:             if (Thread.interrupted()) {
929:         Thread.currentThread().interrupt();
1155:     // arbitrary cycles using a thread local but this should be a good enough solution (it is also
1189:     /** Non volatile write of the thread to the {@link Waiter#thread} field. */
1250:         WAITER_THREAD_OFFSET = unsafe.objectFieldOffset(Waiter.class.getDeclaredField("thread"));
1261:       UNSAFE.putObject(waiter, WAITER_THREAD_OFFSET, newValue);
1297:         AtomicReferenceFieldUpdater<Waiter, Thread> waiterThreadUpdater,
1344:       waiter.thread = newValue;
368:   /** All waiting threads. */
934:   /** Unblocks all threads and runs all listeners. */
1034:   /** Releases all threads in the {@link #waiters} list, and clears the list. */
1302:       this.waiterThreadUpdater = waiterThreadUpdater;
1311:       waiterThreadUpdater.lazySet(waiter, newValue);
github.com/apache/beam:sdks/go/pkg/beam/model/fnexecution_v1/beam_fn_api.pb.go: [ master, ]
3461: 	Thread               string   `protobuf:"bytes,8,opt,name=thread,proto3" json:"thread,omitempty"`
3541: func (m *LogEntry) GetThread() string {
3460: 	// (Optional) The name of the thread this log statement is associated with.
3543: 		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/GNOME/gimp:tools/performance-log-viewer.py: [ mainline, ]
285: Thread = namedtuple ("Thread", ("id", "name", "state", "frames"))
744:                 def thread (id, state = None):
734:                 def match_thread (thread, id, state = None):
2930:         def thread_filter_source_get (self):
2933:         def thread_filter_source_set (self, thread_filter):
2940:         def thread_filter_button_toggled (self, button):
275: class ThreadState (enum.Enum):
1955:     class ThreadStore (Gtk.ListStore):
2237:     def threads_row_activated (self, tree, path, col):
2257:     def threads_selection_changed (self, tree_sel):
2433:     class ThreadFilter (Gtk.TreeView):
2557:     class ThreadPopover (Gtk.Popover):
312:             for thread in element.find ("backtrace").iterfind ("thread"):
313:                 id      = thread.get ("id")
314:                 name    = thread.get ("name")
315:                 running = thread.get ("running")
317:                 t = Thread (
325:                 for frame in thread.iterfind ("frame"):
722:             f = eval ("lambda thread, function, %s: %s" % (
737:                              id == thread.id)                 or  \
739:                              thread.name                      and \
740:                              re.fullmatch (id, thread.name))) and \
742:                             re.fullmatch (state, str (thread.state)))
745:                     return any (match_thread (thread, id, state)
746:                                 for thread in samples[i].backtrace or [])
749:                     for thread in samples[i].backtrace or []:
750:                         if match_thread (thread, id, state):
751:                             for frame in thread.frames:
757:                 if f (thread, function, **{
2024:         self.thread_store = store
2028:         self.thread_tree = tree
2205:         sel_rows = self.thread_tree.get_selection ().get_selected_rows ()[1]
2208:             tid = self.thread_store[sel_rows[0]][self.ThreadStore.ID]
2212:         self.thread_store.clear ()
2215:             thread = samples[i].backtrace[t]
2217:             iter = self.thread_store.append (
2218:                 (t, thread.id, thread.name, str (thread.state))
2221:             if thread.id == tid:
2222:                 self.thread_tree.get_selection ().select_iter (iter)
2238:         iter = self.thread_store.get_iter (path)
2240:         tid = self.thread_store[iter][self.ThreadStore.ID]
2245:             threads = filter (lambda thread:
2246:                                 thread.id    == tid and
2247:                                 thread.state == ThreadState.RUNNING,
2298:             for thread in sample.backtrace or []:
2299:                 for frame in thread.frames:
2446:                 threads = list ({thread.id
2448:                                  for thread in sample.backtrace or ()})
2532:             threads = {thread.id: thread.name
2534:                        for thread in samples[i].backtrace or ()}
2574:             thread_filter = ProfileViewer.ThreadFilter ()
2575:             self.thread_filter = thread_filter
2576:             scrolled.add (thread_filter)
2577:             thread_filter.show ()
2640:                 thread_filter_store = popover.thread_filter.store
2642:                 self.thread_filter_store = thread_filter_store
2643:                 self.thread_filter       = thread_filter_store.get_filter ()
2645:                 history.add_source (self.thread_filter_source_get,
2646:                                     self.thread_filter_source_set)
2652:                 button.connect ("toggled", self.thread_filter_button_toggled)
2762:                 for thread in samples[i].backtrace or []:
2763:                     if thread.state in self.thread_filter[thread.id]:
2764:                         thread_frames = thread.frames
2767:                             thread_frames = reversed (thread_frames)
2772:                         for frame in thread_frames:
2931:             return self.thread_filter_store.get_filter ()
2934:             self.thread_filter = thread_filter
2936:             self.thread_filter_store.set_filter (thread_filter)
2942:                 thread_filter = self.thread_filter_store.get_filter ()
2944:                 if thread_filter != self.thread_filter:
2945:                     self.thread_filter = thread_filter
281:             ThreadState.SUSPENDED: "S",
282:             ThreadState.RUNNING:   "R"
320:                     state  = ThreadState.RUNNING if running and int (running) \
321:                              else ThreadState.SUSPENDED,
2012:         header = Gtk.HeaderBar (title = "Threads", has_subtitle = False)
2023:         store = self.ThreadStore ()
2033:         tree.connect ("row-activated", self.threads_row_activated)
2036:                                        self.threads_selection_changed)
2044:         col.add_attribute (cell, "text", self.ThreadStore.ID)
2052:         col.add_attribute (cell, "text", self.ThreadStore.NAME)
2060:         col.add_attribute (cell, "text", self.ThreadStore.STATE)
2250:             if list (threads):
2438:             STATE   = {list (ThreadState)[i]: 3 + i
2439:                        for i in range (len (ThreadState))}
2449:                 threads.sort ()
2451:                 states = [state == ThreadState.RUNNING for state in self.STATE]
2453:                 for id in threads:
2539:                 if id in threads:
2541:                     row[self.store.NAME]    = threads[id]
2638:                 popover = ProfileViewer.ThreadPopover ()
2659:                 label = Gtk.Label (label = "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/GNOME/gimp:app/widgets/gimpdashboard.c: [ mainline, ]
299:   GThread                      *thread;
146:   VARIABLE_ASSIGNED_THREADS,
147:   VARIABLE_ACTIVE_THREADS,
1254:   /* sampler thread
1256:    * we use a separate thread for sampling, so that data is sampled even when
1257:    * the main thread is busy
1259:   priv->thread = g_thread_new ("dashboard",
1374:   if (priv->thread)
1383:       g_clear_pointer (&priv->thread, g_thread_join);
3660:       gint     thread;
3681:           for (thread = 0; thread < n_threads; thread++)
3683:               guintptr thread_id;
3685:               thread_id = gimp_backtrace_get_thread_id (priv->log_backtrace,
3686:                                                         thread);
3688:               if (gimp_backtrace_find_thread_by_id (backtrace,
3689:                                                     thread_id, thread) < 0)
3691:                   const gchar *thread_name;
3695:                   thread_name =
3696:                     gimp_backtrace_get_thread_name (priv->log_backtrace,
3697:                                                     thread);
3700:                                              "<thread id=\"%llu\"",
3701:                                              (unsigned long long) thread_id);
3703:                   if (thread_name)
3707:                       gimp_dashboard_log_print_escaped (dashboard, thread_name);
3720:       for (thread = 0; thread < n_threads; thread++)
3722:           guintptr     thread_id;
3723:           const gchar *thread_name;
3732:           thread_id   = gimp_backtrace_get_thread_id     (backtrace, thread);
3733:           thread_name = gimp_backtrace_get_thread_name   (backtrace, thread);
3735:           running     = gimp_backtrace_is_thread_running (backtrace, thread);
3736:           n_frames    = gimp_backtrace_get_n_frames      (backtrace, thread);
3740:               gint other_thread = gimp_backtrace_find_thread_by_id (
3741:                 priv->log_backtrace, thread_id, thread);
3743:               if (other_thread >= 0)
3748:                   last_running  = gimp_backtrace_is_thread_running (
3749:                     priv->log_backtrace, other_thread);
3751:                     priv->log_backtrace, other_thread);
3758:                                                             thread, i) !=
3760:                                                             other_thread, i))
3772:                                                             thread, -i - 1) !=
3774:                                                             other_thread, -i - 1))
3794:                                      "<thread id=\"%llu\"",
3795:                                      (unsigned long long) thread_id);
3797:           if (thread_name)
3801:               gimp_dashboard_log_print_escaped (dashboard, thread_name);
3834:                                                               thread, frame);
3844:                                          "</thread>\n");
694:   [VARIABLE_ASSIGNED_THREADS] =
695:   { .name             = "assigned-threads",
697:     .description      = N_("Number of assigned worker threads"),
700:     .data             = "assigned-threads"
703:   [VARIABLE_ACTIVE_THREADS] =
704:   { .name             = "active-threads",
706:     .description      = N_("Number of active worker threads"),
709:     .data             = "active-threads"
949:                           { .variable       = VARIABLE_ASSIGNED_THREADS,
952:                           { .variable       = VARIABLE_ACTIVE_THREADS,
3659:       gint     n_threads;
3679:           n_threads = gimp_backtrace_get_n_threads (priv->log_backtrace);
3718:       n_threads = gimp_backtrace_get_n_threads (backtrace);
1260:                                (GThreadFunc) gimp_dashboard_sample,
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/tensorflow/models:official/utils/logs/logger.py: [ master, ]
34: from six.moves import _thread as thread
253:       # Starting new thread for bigquery upload in case it might take long time
255:       # thread might have potential performance impact for model that run on
257:       thread.start_new_thread(
278:     # Starting new thread for bigquery upload in case it might take long time
280:     # thread might have potential performance impact for model that run on CPU.
281:     thread.start_new_thread(
287:     thread.start_new_thread(
31: import threading
55: _logger_lock = threading.Lock()
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 {
chromium.googlesource.com/chromium/deps/psyco_win32:psyco/profiler.py: [ master, ]
20:     import dummy_thread as thread
365: def psyco_start_new_thread(callable, args, kw=None):
371: original_start_new_thread = thread.start_new_thread
358: def psyco_thread_stub(callable, args, kw):
18:     import thread
32: # a lock for a thread-safe go()
33: go_lock = thread.allocate_lock()
260:         self.lock = thread.allocate_lock()
343: # and thread.start_new_thread().
366:     "This is the Psyco-aware version of thread.start_new_thread()."
367:     return original_start_new_thread(psyco_thread_stub, (callable, args, kw))
374: thread.start_new_thread = psyco_start_new_thread
375: # hack to patch threading._start_new_thread if the module is
378:     hasattr(sys.modules['threading'], '_start_new_thread')):
379:     sys.modules['threading']._start_new_thread = psyco_start_new_thread
204:             alarm.stop(1)   # wait for parallel threads to stop
377: if ('threading' in sys.modules and
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)
2807:     numCPUs = threadsInfo.GetNumProcessThreads();
3044:     PrintRequirements(*printCallback, "size: ", ramSize_Defined, ramSize, "CPU hardware threads:", numCPUs);
3045:     printCallback->Print(GetProcessThreadsInfo(threadsInfo));
3198:   // ---------- Threads loop ----------
3199:   for (unsigned threadsPassIndex = 0; threadsPassIndex < 3; threadsPassIndex++)
3206:     if (threadsPassIndex != 0)
3212:     if (threadsPassIndex != 0)
3217:       if (threadsPassIndex == 1)
3233:   if (threadsPassIndex > 0)
3263:   PrintRequirements(f, "usage:", true, GetBenchMemoryUsage(numThreads, dict, totalBenchMode), "Benchmark threads:   ", numThreads);
1063:       RINOK(setCoderMt->SetNumberOfThreads(NumDecoderSubThreads));
1170:         numThreads
1194:   UInt32 numEncoderThreads = 1;
1195:   UInt32 numSubDecoderThreads = 1;
1198:     numEncoderThreads = numThreads;
1202:       if (numThreads == 1 && method.Get_NumThreads() < 0)
1203:         method.AddProp_NumThreads(1);
1204:       const UInt32 numLzmaThreads = method.Get_Lzma_NumThreads();
1205:       if (numThreads > 1 && numLzmaThreads > 1)
1207:         numEncoderThreads = numThreads / 2;
1208:         numSubDecoderThreads = 2;
1213:   CBenchEncoders encodersSpec(numEncoderThreads);
1218:   for (i = 0; i < numEncoderThreads; i++)
1239:     for (UInt32 j = 0; j < numSubDecoderThreads; j++)
1257:   for (i = 0; i < numEncoderThreads; i++)
1273:   for (i = 0; i < numEncoderThreads; i++)
1290:       bpi->BenchInfo.NumIterations = numEncoderThreads;
1295:     if (numEncoderThreads > 1)
1311:   if (numEncoderThreads > 1)
1312:     for (i = 0; i < numEncoderThreads; i++)
1325:   for (i = 0; i < numEncoderThreads; i++)
1338:   UInt32 numDecoderThreads = numEncoderThreads * numSubDecoderThreads;
1340:   for (i = 0; i < numEncoderThreads; i++)
1349:       bpi->BenchInfo.NumIterations = numDecoderThreads;
1357:       int numSubThreads = method.Get_NumThreads();
1358:       encoder.NumDecoderSubThreads = (numSubThreads <= 0) ? 1 : numSubThreads;
1360:     if (numDecoderThreads > 1)
1362:       for (UInt32 j = 0; j < numSubDecoderThreads; j++)
1366:             , ((i * numSubDecoderThreads + j) * 16 * 21) & 0x7FF
1381:   if (numDecoderThreads > 1)
1382:     for (i = 0; i < numEncoderThreads; i++)
1383:       for (UInt32 j = 0; j < numSubDecoderThreads; j++)
1398:   if (numDecoderThreads > 1)
1399:     for (i = 0; i < numEncoderThreads; i++)
1400:       for (UInt32 j = 0; j < numSubDecoderThreads; j++)
1411:   info.NumIterations = numSubDecoderThreads * encoders[0].NumIterations;
1413:   for (i = 0; i < numEncoderThreads; i++)
1443: UInt64 GetBenchMemoryUsage(UInt32 numThreads, UInt32 dictionary, bool totalBench)
1447:   bool lzmaMt = (totalBench || numThreads > 1);
1448:   UInt32 numBigThreads = numThreads;
1450:     numBigThreads /= 2;
1452:     GetLZMAUsage(lzmaMt, dictionary) + (2 << 20)) * numBigThreads;
1550:     for (UInt32 i = 0; i < NumThreads; i++)
1552:     NumThreads = 0;
1608:     for (UInt32 i = 0; i < NumThreads; i++)
1610:     NumThreads = 0;
1870:   // s.Add_UInt32(ti.numProcessThreads);
1873:     // if (ti.numProcessThreads != ti.numSysThreads)
1876:       s.Add_UInt32(ti.GetNumSystemThreads());
1954:   PrintNumber(f, numThreads, 3);
2068:     UInt32 numThreads,
2097:         false, numThreads, method,
2122:     UInt32 numThreads,
2134:   if (numThreads == 0)
2135:     numThreads = 1;
2138:   numThreads = 1;
2150:   if (numThreads > 1)
2154:     for (i = 0; i < numThreads; i++)
2163:     for (i = 0; i < numThreads; i++)
2170:     for (i = 0; i < numThreads; i++)
2198:       UInt64 numCommands = (UInt64)numIterations * bufferSize * numThreads * complexity;
2200:       cpuFreq = rating / numThreads;
2217:     UInt32 numThreads, UInt32 bufferSize,
2226:   if (numThreads == 0)
2227:     numThreads = 1;
2230:   numThreads = 1;
2242:   size_t totalSize = (size_t)bufferSize * numThreads;
2243:   if (totalSize / numThreads != bufferSize)
2259:   if (numThreads > 1)
2264:     for (i = 0; i < numThreads; i++)
2299:     for (i = 0; i < numThreads; i++)
2306:     for (i = 0; i < numThreads; i++)
2335:   UInt64 unpSizeThreads = unpSize * numThreads;
2336:   info.UnpackSize = unpSizeThreads;
2337:   info.PackSize = unpSizeThreads;
2343:       UInt64 numCommands = unpSizeThreads * complexity / 256;
2352:   speed = info.GetSpeed(unpSizeThreads);
2360:     UInt32 numThreads, UInt32 bufSize,
2382:         numThreads, bufSize,
2425:   return (num <= numThreads) ? num : numThreads;
2815:   UInt32 numThreadsSpecified = numCPUs;
2821:   bool multiThreadTests = false;
2905:         multiThreadTests = true;
2909:       RINOK(ParseMtProp(s, propVariant, numCPUs, numThreadsSpecified));
3049:   if (numThreadsSpecified < 1 || numThreadsSpecified > kNumThreadsMax)
3067:         true, numThreadsSpecified,
3125:     unsigned numThreadsTests = 0;
3128:       UInt32 t = GetNumThreadsNext(numThreadsTests, numThreadsSpecified);
3130:       numThreadsTests++;
3131:       if (t >= numThreadsSpecified)
3136:     CTempValues speedTotals(numThreadsTests);
3138:       for (unsigned ti = 0; ti < numThreadsTests; ti++)
3158:         for (unsigned ti = 0; ti < numThreadsTests; ti++)
3161:           UInt32 t = GetNumThreadsNext(ti, numThreadsSpecified);
3179:       for (unsigned ti = 0; ti < numThreadsTests; ti++)
3202:   UInt32 numThreads = numThreadsSpecified;
3204:   if (!multiThreadTests)
3211:     numThreads = 1;
3216:       numThreads = numCPUs;
3220:           numThreads = numCPUs / 2;
3250:       if (GetBenchMemoryUsage(numThreads, ((UInt32)1 << dicSizeLog), totalBenchMode) + (8 << 20) <= ramSize)
3361:         RINOK(FreqBench(complexInCommands, numThreads, printCallback,
3380:             complexInCommands, numThreads,
3388:       res = TotalBench_Hash(EXTERNAL_CODECS_LOC_VARS complexInCommands, numThreads,
3397:         RINOK(FreqBench(complexInCommands, numThreads, printCallback,
3487:           true, numThreads,
android.googlesource.com/platform/external/pthreads:implement.h: [ master, ]
130:   DWORD thread;
444:   ptw32_thread_t * thread;
131:   HANDLE threadH;		/* Win32 thread handle - POSIX thread is invalid if threadH == 0 */
139:   pthread_mutex_t threadLock;	/* Used for serialised access to public thread state */
210:   pthread_t ownerThread;
271:   void *threads;
275: typedef struct ThreadParms ThreadParms;
276: typedef struct ThreadKeyAssoc ThreadKeyAssoc;
278: struct ThreadParms
344: struct ThreadKeyAssoc
447:   ThreadKeyAssoc *nextThread;
449:   ThreadKeyAssoc *prevThread;
123: typedef struct ptw32_thread_t_ ptw32_thread_t;
125: struct ptw32_thread_t_
522: #define PTW32_THREAD_REUSE_EMPTY ((ptw32_thread_t *) 1)
162: struct pthread_attr_t_
198: struct pthread_mutex_t_
215: struct pthread_mutexattr_t_
242: struct pthread_spinlock_t_
252: struct pthread_barrier_t_
261: struct pthread_barrierattr_t_
266: struct pthread_key_t_
286: struct pthread_cond_t_
304: struct pthread_condattr_t_
311: struct pthread_rwlock_t_
322: struct pthread_rwlockattr_t_
108:   PThreadStateInitial = 0,	/* Thread not running                   */
109:   PThreadStateRunning,		/* Thread alive & kicking               */
110:   PThreadStateSuspended,	/* Thread alive but suspended           */
111:   PThreadStateCancelPending,	/* Thread alive but is                  */
113:   PThreadStateCanceling,	/* Thread alive but is                  */
116:   PThreadStateException,	/* Thread alive but exiting             */
118:   PThreadStateLast
120: PThreadState;
696: #define _beginthreadex(security, \
709: #define _endthreadex ExitThread
104:    * This enumeration represents the state of the thread;
105:    * The thread is still "alive" if the numeric value of the
132:   pthread_t ptHandle;		/* This thread's permanent pthread_t handle */
133:   ptw32_thread_t * prevReuse;	/* Links threads on reuse stack */
206:   int recursive_count;		/* Number of unlocks a thread needs to perform
348:    *      This structure creates an association between a thread and a key.
350:    *      destroy routine for thread specific data registered by a user upon
351:    *      exiting a thread.
357:    *         T - Thread that has called pthread_setspecific(Kn)
358:    *            (head of chain is thread->keys)
377:    *      general lock (guarding the row) and the thread's general
381:    *      be released - both the key must be deleted and the thread
383:    *      allows the resources to be freed as soon as either thread or
387:    *      and thread locks are always acquired in the order: key lock
388:    *      then thread lock. An exception to this exists when a thread
392:    *      An association is created when a thread first calls
397:    *      thread calls the key destructor function on thread exit, or
401:    *      thread
402:    *              reference to the thread that owns the
404:    *              thread struct itself. Since the association is
405:    *              destroyed before the thread exits, this can never
406:    *              point to a different logical thread to the one that
407:    *              created the assoc, i.e. after thread struct reuse.
434:    *      1)      As soon as either the key or the thread is no longer
521: /* Thread Reuse stack bottom marker. Must not be NULL or any valid pointer to memory. */
525: extern ptw32_thread_t * ptw32_threadReuseTop;
526: extern ptw32_thread_t * ptw32_threadReuseBottom;
540: extern CRITICAL_SECTION ptw32_thread_reuse_lock;
595:   void ptw32_threadReusePush (pthread_t thread);
599:   int ptw32_setthreadpriority (pthread_t thread, int policy, int priority);
610:   void ptw32_callUserDestroyRoutines (pthread_t thread);
612:   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
141:   pthread_mutex_t cancelLock;	/* Used for async-cancel safety */
188:   pthread_mutex_t lock;
212: 				   threads. */
248:     pthread_mutex_t mutex;	/* mutex if single cpu.            */
270:   pthread_mutex_t keyLock;
280:   pthread_t tid;
288:   long nWaitersBlocked;		/* Number of threads blocked            */
289:   long nWaitersGone;		/* Number of threads timed out          */
290:   long nWaitersToUnblock;	/* Number of threads to unblock         */
291:   sem_t semBlockQueue;		/* Queue up threads waiting for the     */
296:   pthread_mutex_t mtxUnblockLock;	/* Mutex that guards access to          */
299:   pthread_cond_t next;		/* Doubly linked list                   */
300:   pthread_cond_t prev;
313:   pthread_mutex_t mtxExclusiveAccess;
314:   pthread_mutex_t mtxSharedAccessCompleted;
315:   pthread_cond_t cndSharedAccessCompleted;
356:    *            (head of chain is key->threads)
393:    *      pthread_setspecific() on a key that has a specified
413:    *              The pthread_t->keys attribute is the head of a
416:    *              between a pthread_t and all pthread_key_t on which
417:    *              it called pthread_setspecific.
422:    *      nextThread
423:    *              The pthread_key_t->threads attribute is the head of
426:    *              relationship between a pthread_key_t and all the 
427:    *              PThreads that have called pthread_setspecific for
428:    *              this pthread_key_t.
430:    *      prevThread
439:    *              pthread_setspecific if the user provided a
445:   pthread_key_t key;
446:   ThreadKeyAssoc *nextKey;
448:   ThreadKeyAssoc *prevKey;
518: /* Declared in pthread_cancel.c */
527: extern pthread_key_t ptw32_selfThreadKey;
528: extern pthread_key_t ptw32_cleanupKey;
529: extern pthread_cond_t ptw32_cond_list_head;
530: extern pthread_cond_t ptw32_cond_list_tail;
548: extern int pthread_count;
564:   int ptw32_is_attr (const pthread_attr_t * attr);
566:   int ptw32_cond_check_need_init (pthread_cond_t * cond);
567:   int ptw32_mutex_check_need_init (pthread_mutex_t * mutex);
568:   int ptw32_rwlock_check_need_init (pthread_rwlock_t * rwlock);
581: 			       HANDLE threadH, DWORD callback_arg);
587:   void ptw32_threadDestroy (pthread_t tid);
591:   pthread_t ptw32_new (void);
593:   pthread_t ptw32_threadReusePop (void);
608:     ptw32_threadStart (void *vthreadParms);
614:   void ptw32_tkAssocDestroy (ThreadKeyAssoc * assoc);
649:   _CRTIMP unsigned long __cdecl _beginthread (void (__cdecl *) (void *),
651:   _CRTIMP void __cdecl _endthread (void);
689: #if defined(__CYGWIN32__) || defined(__CYGWIN__) || defined(NEED_CREATETHREAD)
692:  * Macro uses args so we can cast start_proc to LPTHREAD_START_ROUTINE
702:         CreateThread(security, \
704:                      (LPTHREAD_START_ROUTINE) start_proc, \
711: #endif				/* __CYGWIN32__ || __CYGWIN__ || NEED_CREATETHREAD */
12:  *      Copyright(C) 1999,2005 Pthreads-win32 contributors
20:  *      http://sources.redhat.com/pthreads-win32/contributors.html
106:    * state is greater or equal "PThreadStateRunning".
134:   volatile PThreadState state;
425:    *              nextThreads link. This chain provides the 1 to many
652:   _CRTIMP unsigned long __cdecl _beginthreadex (void *, unsigned,
655:   _CRTIMP void __cdecl _endthreadex (unsigned);
685:  * Question 1 - How do I get pthreads-win32 to link under Cygwin or Mingw32?
android.googlesource.com/platform/superproject:external/perfetto/protos/perfetto/trace/perfetto_trace.proto: [ master, ]
840:   optional int32 thread = 2;
3529:   message Thread {
4674:   optional ThreadDescriptor thread = 4;
754:       THREAD_CPUTIME = 8;
830:   optional int32 to_thread = 4;
2976:   optional uint32 thread_id = 5;
4301:     THREAD_UNSPECIFIED = 0;
4303:     THREAD_MAIN = 1;
4304:     THREAD_IO = 2;
4307:     THREAD_POOL_BG_WORKER = 3;
4308:     THREAD_POOL_FG_WORKER = 4;
4309:     THREAD_POOL_BG_BLOCKING = 6;
4310:     THREAD_POOL_FG_BLOCKING = 5;
4311:     THREAD_POOL_SERVICE = 7;
4314:     THREAD_COMPOSITOR = 8;
4315:     THREAD_VIZ_COMPOSITOR = 9;
4316:     THREAD_COMPOSITOR_WORKER = 10;
4319:     THREAD_SERVICE_WORKER = 11;
4322:     THREAD_MEMORY_INFRA = 50;
4323:     THREAD_SAMPLING_PROFILER = 51;
4325:   optional ThreadType thread_type = 1;
4569:   optional string thread_name = 5;
4675:   optional ChromeThreadDescriptor chrome_thread = 7;
4915:     optional int64 thread_duration_us = 4;
4918:     optional int64 thread_instruction_delta = 15;
4952:       SCOPE_THREAD = 3;
3555:     repeated Thread threads_deprecated = 4 [deprecated = true];
3569:   repeated Thread threads = 2;
4300:   enum ThreadType {
4565: message ThreadDescriptor {
3075:     ROOT_THREAD_BLOCK = 6;
3077:     ROOT_THREAD_OBJECT = 8;
4030:     optional bool main_thread_missed_last_deadline = 34;
4219:     STEP_MAIN_THREAD_SCROLL_UPDATE = 2;
4374:     COUNTER_THREAD_TIME_NS = 1;            // implies UNIT_TIME_NS.
4375:     COUNTER_THREAD_INSTRUCTION_COUNT = 2;  // implies UNIT_COUNT.
4576:     CHROME_THREAD_UNSPECIFIED = 0;
4578:     CHROME_THREAD_MAIN = 1;
4579:     CHROME_THREAD_IO = 2;
4582:     CHROME_THREAD_POOL_BG_WORKER = 3;
4583:     CHROME_THREAD_POOL_FG_WORKER = 4;
4584:     CHROME_THREAD_POOL_FB_BLOCKING = 5;
4585:     CHROME_THREAD_POOL_BG_BLOCKING = 6;
4586:     CHROME_THREAD_POOL_SERVICE = 7;
4589:     CHROME_THREAD_COMPOSITOR = 8;
4590:     CHROME_THREAD_VIZ_COMPOSITOR = 9;
4591:     CHROME_THREAD_COMPOSITOR_WORKER = 10;
4594:     CHROME_THREAD_SERVICE_WORKER = 11;
4597:     CHROME_THREAD_MEMORY_INFRA = 50;
4598:     CHROME_THREAD_SAMPLING_PROFILER = 51;
4600:   optional ChromeThreadType chrome_thread_type = 4;
4610:   optional int64 reference_thread_time_us = 7;
4611:   optional int64 reference_thread_instruction_count = 8;
5383:   optional bool record_thread_names = 3;
4299: message ChromeThreadDescriptor {
4575:   enum ChromeThreadType {
2975:   // ID of the thread that emitted the event.
3489: // they are dumped at a different rate than cmdline and thread list.
3528:   // Representation of a thread.
3530:     // The thread id (as per gettid())
3533:     // Thread group id (i.e. the PID of the process, == TID of the main thread)
3536:     // The name of the thread.
3542:     // The UNIX process ID, aka thread group ID (as per getpid()).
3549:     // If it is a kernel thread there will only be one cmdline field
3563:   // different ProcessTree messages. A thread might event not show up at all, if
3763:     ThreadDescriptor thread_descriptor = 44;
4292: // Begin of protos/perfetto/trace/track_event/chrome_thread_descriptor.proto
4294: // Describes a Chrome thread's attributes. Emitted as part of a TrackDescriptor,
4295: // usually by the thread's trace writer. Must be paired with a ThreadDescriptor
4327:   // To support old UI. New UI should determine default sorting by thread_type.
4331: // End of protos/perfetto/trace/track_event/chrome_thread_descriptor.proto
4351: // Defines properties of a counter track, e.g. for built-in counters (thread
4372:     // Thread-scoped counters. The thread's track should be specified via
4388:   // For built-in counters (e.g. thread time). Custom user-specified counters
4403:   // COUNTER_THREAD_TIME_NS timestamps in microseconds instead.
4408:   // thread time). Counter values in subsequent packets on the current packet
4499: // usually by the process's main thread.
4559: // Begin of protos/perfetto/trace/track_event/thread_descriptor.proto
4561: // Describes a thread's attributes. Emitted as part of a TrackDescriptor,
4562: // usually by the thread's trace writer.
4613:   // To support old UI. New UI should determine default sorting by thread_type.
4617: // End of protos/perfetto/trace/track_event/thread_descriptor.proto
4647:   // Similarly, to associate a COUNTER_THREAD_TIME_NS counter track with a
4648:   // thread, specify the uuid for that thread's thread track here.
4652:   // process/thread name (process/thread tracks), the first event's name (async
4667:   // Associate the track with a thread, indicating that the track's events
4668:   // describe synchronous code execution on the thread. There should only be one
4669:   // such track per thread (trace processor uses this fact to detect tid reuse).
4671:   // Trace processor will merge events on a thread track with slice-type events
4672:   // from other sources (e.g. ftrace) for the same thread into a single timeline
4691: // which describe activity on a track, such as a thread or asynchronous event
4705: // To associate an event with a custom track (e.g. a thread), the track is
4712: //       // Optionally, associate the track with a thread.
4713: //       thread_descriptor {
4803:   // sequence (in most cases sequence = one thread). If no value is specified
4828:   // For example, this allows snapshotting the thread time clock at each
4829:   // thread-track BEGIN and END event to capture the cpu time delta of a slice.
4876:   // encode thread time instead.
4878:   // CPU time for the current thread (e.g., CLOCK_THREAD_CPUTIME_ID) in
4880:   oneof thread_time {
4886:     int64 thread_time_delta_us = 2;
4889:     int64 thread_time_absolute_us = 17;
4893:   // encode thread instruction count instead.
4895:   // Value of the instruction counter for the current thread.
4896:   oneof thread_instruction_count {
4897:     // Same encoding as |thread_time| field above.
4898:     int64 thread_instruction_count_delta = 8;
4899:     int64 thread_instruction_count_absolute = 20;
4902:   // Apart from {category, time, thread time, tid, pid}, other legacy trace
4930:     // Consider the thread timestamps for async BEGIN/END event pairs as valid.
4957:     // another process/thread. This should be the exception. Normally, the
5381:   // If enabled thread names are also recoded (this is redundant if sched_switch
3401:   // TODO(eseckler): ThreadDescriptor-based timestamps are deprecated. Replace
3553:     // No longer used as of Apr 2018, when the dedicated |threads| field was
3561:   // List of processes and threads in the client. These lists are incremental
3562:   // and not exhaustive. A process and its threads might show up separately in
3565:   // #0 { processes: [{pid: 10, ...}], threads: [{pid: 11, tgid: 10}] }
3566:   // #1 { threads: [{pid: 12, tgid: 10}] }
3567:   // #2 { processes: [{pid: 20, ...}], threads: [{pid: 13, tgid: 10}] }
3813:     // Process/ThreadDescriptors. This flag only affects the current packet
4321:     // Tracing related threads:
4596:     // Tracing related threads:
4863:     // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
4865:     // preceding TrackEvents since the last ThreadDescriptor and add the sum to
4866:     // the |reference_timestamp| in ThreadDescriptor. This value should always
4881:     // Delta timestamp value since the last TrackEvent or ThreadDescriptor. To
4883:     // preceding TrackEvents since the last ThreadDescriptor and add the sum to
4884:     // the |reference_timestamp| in ThreadDescriptor. This value should always
4958:     // pid+tid from ThreadDescriptor is used.
android.googlesource.com/platform/external/perfetto:protos/perfetto/trace/perfetto_trace.proto: [ master, ] Duplicate result
chromium.googlesource.com/arc/arc:third_party/chromium-ppapi/sandbox/win/src/nt_internals.h: [ master, ]
792:   HANDLE thread;
37: #define CURRENT_THREAD ((HANDLE)-2)
265:   PVOID UniqueThread;
281:   ThreadBasicInformation,
282:   ThreadTimes,
283:   ThreadPriority,
284:   ThreadBasePriority,
285:   ThreadAffinityMask,
286:   ThreadImpersonationToken,
287:   ThreadDescriptorTableEntry,
288:   ThreadEnableAlignmentFaultFixup,
289:   ThreadEventPair,
290:   ThreadQuerySetWin32StartAddress,
291:   ThreadZeroTlsCell,
292:   ThreadPerformanceCount,
293:   ThreadAmILastThread,
294:   ThreadIdealProcessor,
295:   ThreadPriorityBoost,
296:   ThreadSetTlsArrayAddress,
297:   ThreadIsIoPending,
298:   ThreadHideFromDebugger
280: typedef enum _NT_THREAD_INFORMATION_CLASS {
299: } NT_THREAD_INFORMATION_CLASS,
300:     *PNT_THREAD_INFORMATION_CLASS;
268: typedef NTSTATUS(WINAPI* NtOpenThreadFunction)(OUT PHANDLE ThreadHandle,
302: typedef NTSTATUS(WINAPI* NtSetInformationThreadFunction)(
360: typedef NTSTATUS(WINAPI* NtOpenThreadTokenFunction)(IN HANDLE ThreadHandle,
366: typedef NTSTATUS(WINAPI* NtOpenThreadTokenExFunction)(IN HANDLE ThreadHandle,
391: typedef NTSTATUS(WINAPI* RtlCreateUserThreadFunction)(
261: // Process and Thread
304:     IN NT_THREAD_INFORMATION_CLASS ThreadInformationClass,
400:     OUT PHANDLE Thread,
303:     IN HANDLE ThreadHandle,
305:     IN PVOID ThreadInformation,
306:     IN ULONG ThreadInformationLength);
393:     IN PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
398:     IN LPTHREAD_START_ROUTINE StartAddress,
chromium.googlesource.com/ios-chromium-mirror:sandbox/win/src/nt_internals.h: [ master, ] Duplicate result
chromium.googlesource.com/chromium/src:sandbox/win/src/nt_internals.h: [ master, ] Duplicate result
chromium.googlesource.com/chromium/src/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,
605:     std::string thread_name;
615:     int64_t thread_id = 0;
770:   const PlatformThreadRef thread_id_;  // The thread this instance is bound to.
1207:   std::atomic<int> thread_tracker_count_;
1210:   ActivityTrackerMemoryAllocator thread_tracker_allocator_;
1211:   Lock thread_tracker_allocator_lock_;
160:   static ActivityData ForThread(const int64_t id) {
585: class BASE_EXPORT ThreadActivityTracker {
962:   ThreadActivityTracker* GetTrackerForCurrentThread() {
973:   ThreadActivityTracker* GetOrCreateTrackerForCurrentThread() {
1083:   class ThreadSafeUserData : public ActivityUserData {
280:     ACT_THREAD_START = ACT_THREAD,
281:     ACT_THREAD_JOIN,
1204:   ThreadLocalOwnedPointer<ThreadActivityTracker> this_thread_tracker_;
859:   class BASE_EXPORT ScopedThreadActivity
1075:     kMaxThreadCount = 100,
1076:     kCachedThreadMemories = 10,
1336: class BASE_EXPORT ScopedThreadJoinActivity
1340:   explicit ScopedThreadJoinActivity(const PlatformThreadHandle* thread)
36: #include "base/threading/platform_thread.h"
37: #include "base/threading/thread_local.h"
162:     data.thread.thread_id = id;