Search some code: Max results:

Found 123281 results in 24942 files (29MB index data, 4977159 ngram matches, 546891 docs considered, 49874 docs (839MB) loaded, 496763 docs skipped): for
(or substr:"thread" substr:"needle") with options &zoekt.SearchOptions{EstimateDocCount:false, Whole:false, ShardMaxMatchCount:250, TotalMaxMatchCount:1000000, ShardMaxImportantMatch:2, TotalMaxImportantMatch:100, MaxWallTime:10000000000}
in 3.000800052s (queued: 1.98┬Ás)

chromium.googlesource.com/external/mockito/mockito:src/main/java/org/mockito/internal/util/concurrent/DetachedThreadLocal.java:[master, ]

136:         THREAD, INLINE, MANUAL
14: public class DetachedThreadLocal<T> implements Runnable {
18:     public DetachedThreadLocal(Cleaner cleaner) {
9:  * A detached local that allows for explicit control of setting and removing values from a thread-local
12:  * Instances of this class are non-blocking and fully thread safe.
16:     final WeakConcurrentMap<Thread, T> map;
20:             case THREAD:
22:                 map = new WeakConcurrentMap<Thread, T>(cleaner == Cleaner.THREAD) {
24:                     protected T defaultValue(Thread key) {
30:                 map = new WeakConcurrentMap.WithInlinedExpunction<Thread, T>() {
32:                     protected T defaultValue(Thread key) {
43:         return map.get(Thread.currentThread());
47:         map.put(Thread.currentThread(), value);
51:         map.remove(Thread.currentThread());
55:      * Clears all thread local references for all threads.
62:      * @param thread The thread to which this thread's thread local value should be pushed.
65:     public T pushTo(Thread thread) {
68:             map.put(thread, inheritValue(value));
74:      * @param thread The thread from which the thread thread local value should be fetched.
77:     public T fetchFrom(Thread thread) {
78:         T value = map.get(thread);
86:      * @param thread The thread for which to set a thread-local value.
87:      * @return The value accociated with this thread.
89:     public T get(Thread thread) {
90:         return map.get(thread);
94:      * @param thread The thread for which to set a thread-local value.
97:     public void define(Thread thread, T value) {
98:         map.put(thread, value);
102:      * @param thread The thread for which an initial value is created.
103:      * @return The initial value for any thread local. If no default is set, the default value is {@code null}.
105:     protected T initialValue(Thread thread) {
118:      * @return The weak map that backs this detached thread local.
120:     public WeakConcurrentMap<Thread, T> getBackingMap() {
130:      * Determines the cleaning format. A reference is removed either by an explicitly started cleaner thread
131:      * associated with this instance ({@link Cleaner#THREAD}), as a result of interacting with this thread local
132:      * from any thread ({@link Cleaner#INLINE} or manually by submitting the detached thread local to a thread
25:                         return DetachedThreadLocal.this.initialValue(key);
33:                         return DetachedThreadLocal.this.initialValue(key);
android.googlesource.com/platform/external/mockito:src/main/java/org/mockito/internal/util/concurrent/DetachedThreadLocal.java:[master, ]
duplicate result
android.googlesource.com/platform/tools/gpu:cc/gapic/thread.h:[master, ]
25: class Thread {
39: inline Thread::Thread(uint64_t id) : mId(id) {}
18: #define GAPIC_THREAD_H
17: #ifndef GAPIC_THREAD_H
24: // Thread represents a single thread of execution in the process.
27:     // current returns the Thread representing the current thread of execution.
28:     static Thread current();
30:     // id returns the process-unique identifier for the Thread.
34:     inline Thread(uint64_t id);
41: inline uint64_t Thread::id() const {
47: #endif // GAPIC_THREAD_H
chromium.googlesource.com/chromiumos/third_party/opencryptoki:testcases/rsa_test/rsa_thread_test.c:[master, ]
77: typedef struct  Thread {
86: } Thread_t;
100: thread_func( void * thid)
89: Thread_t  *threads;
90: unsigned int THREADCNT=NUMTHREADS;
410: long rsa_thread_process_time(SYSTEMTIME t1, SYSTEMTIME t2)
88: #define NUMTHREADS  3
27: long rsa_thread_process_time(SYSTEMTIME t1, SYSTEMTIME t2);
103:    Thread_t *id;
106:    id = (Thread_t *)thid;
383:    diff = rsa_thread_process_time(t1,t2);
494:    threads = (Thread_t *)malloc(sizeof(Thread_t) * THREADCNT);
499: 		//      printf("Creating thread %d\n",threads[i].id);
500: 		pthread_create(&threads[i].tid,NULL,(void*(*)(void *))thread_func,
502: 		//      printf("Creating thread tid %d\n",threads[i].tid);
505: 		//   printf("Joining thread %d\n",threads[i].id);
507: 		printf("Thread[%d] took %d ms for %d operations %6f OP/ms   \n",
75: #include <pthread.h>
78:    pthread_t   tid;
367:       if (debug) printf("%d ",(int)threads[index].tid);
384:    threads[index].total = diff;
385:    threads[index].processed = loopcount - failed;
386:    threads[index].ops = (float) ((float)(loopcount - failed) / (float)diff);
447:       if (strcmp(argv[i], "-threads") == 0) {
448:          THREADCNT = atoi(argv[i+1]);
449:          printf("THREADS %d \n", THREADCNT);
462: 			printf("usage:  %s [-loop <num>] [-threads <num>] [-noskip]"
497: 	for (i=0; i<(int)THREADCNT; i++){
498: 		threads[i].id = i;
501: 				(void *)&(threads[i]));
504: 	for (i=0; i<(int)THREADCNT; i++){
506: 		pthread_join(threads[i].tid,NULL);
508: 		       i, (int)threads[i].total, (int)threads[i].processed,
509: 		       threads[i].ops);
github.com/googlecreativelab/chrome-music-lab:harmonics & strings/js/Thread.js:[master, ]
5: var Thread = function(xp0Pm, yp0Pm, xp1Pm, yp1Pm, indPm, indHarmonicPm, isTopPm, threadControllerPm) {
1: // class:	Thread
52: 	// how close do we have to be to instantly grab a thread - perpendicular distance (px)
60: 	// total length of this thread (when unstretched)
131: Thread.prototype.init = function() {
140: Thread.prototype.redraw = function() {
185: Thread.prototype.upd = function() {
186: 	// is thread currently grabbed
189: 	// is thread currently oscillating
198: Thread.prototype.updOsc = function() {
248: Thread.prototype.updGrab = function() {
250: 	// is this thread being held by a fish?
291: Thread.prototype.stopNote = function() {
298: Thread.prototype.pluck = function(xp, yp, byUser, fish) {
366: Thread.prototype.grab = function(xp, yp, byUser, car) {
386: Thread.prototype.drop = function() {
416: Thread.prototype.startOsc = function() {
430: Thread.prototype.playNote = function(vol, pan) {
445: Thread.prototype.setStretch = function(r) {
452: // desc:      Check when user first clicks if they clicked right on top of a thread,
455: Thread.prototype.checkInstantGrab = function() {
479: // desc:      Check when user first clicks if they clicked right on top of a thread,
482: Thread.prototype.setPosition = function(x0, y0, x1, y1) {
6: 	this.m = threadControllerPm;
67: 	// my overall index number of all threads
278: 		this.m.dropThread(this);
474: 		this.m.grabThread(this, xu, yu, true, null);
github.com/fuchsia-mirror/third_party-re2:re2/nfa.cc:[master, ]
64:   struct Thread {
88:   typedef SparseArray<Thread*> Threadq;
165: NFA::Thread* NFA::AllocThread() {
129:   Thread* free_threads_;  // free list
206: void NFA::AddToThreadq(Threadq* q, int id0, int c, int flag,
67:       Thread* next;  // when on free list
75:     Thread* t;  // if not null, set t0 = t before processing id
81:     AddState(int id, Thread* t)
90:   inline Thread* AllocThread();
91:   inline Thread* Incref(Thread* t);
92:   inline void Decref(Thread* t);
97:   // p is the current input position, and t0 is the current thread.
99:                     const char* p, Thread* t0);
157:   Thread* next;
158:   for (Thread* t = free_threads_; t; t = next) {
166:   Thread* t = free_threads_;
168:     t = new Thread;
178: NFA::Thread* NFA::Incref(Thread* t) {
184: void NFA::Decref(Thread* t) {
205: // p is the current input position, and t0 is the current thread.
207:                        const char* p, Thread* t0) {
228:       // t0 was a thread that we allocated and copied in order to
248:     Thread** tp = &q->find(id)->second;
250:     Thread* t;
338:     Thread* t = i->second;
435: // Returns whether haystack contains needle's memory.
436: static bool StringPieceContains(const StringPiece haystack, const StringPiece needle) {
437:   return haystack.begin() <= needle.begin() &&
438:          haystack.end() >= needle.end();
548:         Thread* t = i->second;
599:     // Start a new thread if there have not been any matches.
600:     // (No point in starting a new thread if there have been
620:       Thread* t = AllocThread();
85:   // Threadq is a list of threads.  The list is sorted by the order
98:   void AddToThreadq(Threadq* q, int id0, int c, int flag,
107:   // Frees all the threads on runq.
109:   inline int Step(Threadq* runq, Threadq* nextq, int c, int flag, const char* p);
123:   Threadq q0_, q1_;     // pre-allocated for Search.
151:   free_threads_ = NULL;
173:   free_threads_ = t->next;
191:   t->next = free_threads_;
192:   free_threads_ = t;
287:         t = AllocThread();
332: // Frees all the threads on runq.
334: int NFA::Step(Threadq* runq, Threadq* nextq, int c, int flag, const char* p) {
337:   for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i) {
343:       // Can skip any threads started after our current best match.
402:           // Cut off the threads that can only find matches
404:           // rest of the current Threadq.
500:   Threadq* runq = &q0_;
501:   Threadq* nextq = &q1_;
547:       for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i) {
627:     // If all the threads have died, stop early.
637:   for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i)
72:   // State for explicit stack in AddToThreadq.
126:   AddState* astack_;    // pre-allocated for AddToThreadq
144:   // See NFA::AddToThreadq() for why this is so.
254:       LOG(DFATAL) << "unhandled " << ip->opcode() << " in AddToThreadq";
360:         AddToThreadq(nextq, ip->out(), c, flag, p+1, t);
558:     // c and flag through to AddToThreadq() along with p-1+1, which is p.
623:       AddToThreadq(runq, start_, p < text.end() ? p[0] & 0xFF : -1, flag, p, t);
android.googlesource.com/platform/external/regex-re2:re2/nfa.cc:[master, ]
57:   struct Thread {
82:   typedef SparseArray<Thread*> Threadq;
157: void NFA::FreeThread(Thread *t) {
164: NFA::Thread* NFA::AllocThread() {
123:   Thread* free_threads_;  // free list
186: void NFA::AddToThreadq(Threadq* q, int id0, int flag,
60:       Thread* next;  // when on free list
84:   inline Thread* AllocThread();
85:   inline void FreeThread(Thread*);
149:   Thread* next;
150:   for (Thread* t = free_threads_; t; t = next) {
165:   Thread* t = free_threads_;
167:     t = new Thread;
220:     Thread** tp = &q->find(id)->second;
222:     Thread* t;
296:     Thread* t = i->second;
394: // Returns whether haystack contains needle's memory.
395: static bool StringPieceContains(const StringPiece haystack, const StringPiece needle) {
396:   return haystack.begin() <= needle.begin() &&
397:          haystack.end() >= needle.end();
504:         Thread* t = i->second;
561:     // Start a new thread if there have not been any matches.
562:     // (No point in starting a new thread if there have been
583:       // temporarily to hold match boundaries for new thread.
79:   // Threadq is a list of threads.  The list is sorted by the order
89:   void AddToThreadq(Threadq* q, int id, int flag,
98:   inline int Step(Threadq* runq, Threadq* nextq, int c, int flag, const char* p);
116:   Threadq q0_, q1_;     // pre-allocated for Search.
142:   free_threads_ = NULL;
160:   t->next = free_threads_;
161:   free_threads_ = t;
171:   free_threads_ = t->next;
234:       t = AllocThread();
266:       t = AllocThread();
290: // Frees all the threads on runq.
292: int NFA::Step(Threadq* runq, Threadq* nextq, int c, int flag, const char* p) {
295:   for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i) {
301:       // Can skip any threads started after our current best match.
303:         FreeThread(t);
328:           FreeThread(t);
330:             FreeThread(i->second);
357:           // Cut off the threads that can only find matches
359:           // rest of the current Threadq.
361:           FreeThread(t);
363:             FreeThread(i->second);
372:     FreeThread(t);
460:   Threadq* runq = &q0_;
461:   Threadq* nextq = &q1_;
503:       for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i) {
589:     // If all the threads have died, stop early.
605:   for (Threadq::iterator i = runq->begin(); i != runq->end(); ++i)
606:     FreeThread(i->second);
65:   // State for explicit stack in AddToThreadq.
119:   AddState* astack_;    // pre-allocated for AddToThreadq
226:       LOG(DFATAL) << "unhandled " << ip->opcode() << " in AddToThreadq";
319:           AddToThreadq(nextq, ip->out(), flag, p+1, t->capture);
585:       AddToThreadq(runq, start_, flag, p, match_);
github.com/html5rocks/www.html5rocks.com:content/tutorials/doodles/lem/static/code/lem-const.js:[master, ]
185:   'needle': ['intro-finale/items-needle-thread', 'intro-finale/items-needle'],
220:   'thread': ['intro-finale/items-thread', 'intro-finale/items-thread'],
218:   'thread-thimble': ['intro-finale/items-thread-thimble',
219:                      'intro-finale/items-thread-thimble'],
236:     'needle', 'halo', 'noodles', 'neutron', 'nose'
239:     'thread', 'pinstripe', 'neutron', 'noodles', 'clove'
259:     'thread', 'thimble', 'earmuffs', 'neutron', 'nose'
265:     'thread', 'thimble', 'noodles', 'neutron', 'nose', 'gnocchi', 'rivet',
github.com/google/grumpy:lib/threading.py:[master, ]
48: class Thread(object):
49:   """Thread is an activity to be executed concurrently."""
17: from __go__.grumpy import StartThread
22:   """Event is a way to signal conditions between threads."""
60:     StartThread(self._run)
android.googlesource.com/platform/external/avahi:avahi-common/thread-watch.c:[master, ]
62: static void* thread(void *userdata){
42:     pthread_t thread_id;
44:     int thread_running;
77: AvahiThreadedPoll *avahi_threaded_poll_new(void) {
107: void avahi_threaded_poll_free(AvahiThreadedPoll *p) {
123: const AvahiPoll* avahi_threaded_poll_get(AvahiThreadedPoll *p) {
129: int avahi_threaded_poll_start(AvahiThreadedPoll *p) {
142: int avahi_threaded_poll_stop(AvahiThreadedPoll *p) {
161: void avahi_threaded_poll_quit(AvahiThreadedPoll *p) {
170: void avahi_threaded_poll_lock(AvahiThreadedPoll *p) {
179: void avahi_threaded_poll_unlock(AvahiThreadedPoll *p) {
40: struct AvahiThreadedPoll {
38: #include "thread-watch.h"
53:      * avahi_simple_poll_quit() can succeed from another thread. */
66:     /* Make sure that signals are delivered to the main thread */
90:     p->thread_running = 0;
110:     /* Make sure that this function is not called from the helper thread */
111:     assert(!p->thread_running || !pthread_equal(pthread_self(), p->thread_id));
113:     if (p->thread_running)
132:     assert(!p->thread_running);
134:     if (pthread_create(&p->thread_id, NULL, thread, p) < 0)
137:     p->thread_running = 1;
145:     if (!p->thread_running)
148:     /* Make sure that this function is not called from the helper thread */
149:     assert(!pthread_equal(pthread_self(), p->thread_id));
155:     pthread_join(p->thread_id, NULL);
156:     p->thread_running = 0;
164:     /* Make sure that this function is called from the helper thread */
165:     assert(pthread_equal(pthread_self(), p->thread_id));
173:     /* Make sure that this function is not called from the helper thread */
174:     assert(!p->thread_running || !pthread_equal(pthread_self(), p->thread_id));
182:     /* Make sure that this function is not called from the helper thread */
183:     assert(!p->thread_running || !pthread_equal(pthread_self(), p->thread_id));
31: #include <pthread.h>
43:     pthread_mutex_t mutex;
49:     pthread_mutex_t *mutex = userdata;
55:     pthread_mutex_unlock(mutex);
57:     pthread_mutex_lock(mutex);
68:     pthread_sigmask(SIG_BLOCK, &mask, NULL);
70:     pthread_mutex_lock(&p->mutex);
72:     pthread_mutex_unlock(&p->mutex);
86:     pthread_mutex_init(&p->mutex, NULL);
98:             pthread_mutex_destroy(&p->mutex);
114:         avahi_threaded_poll_stop(p);
119:     pthread_mutex_destroy(&p->mutex);
151:     pthread_mutex_lock(&p->mutex);
153:     pthread_mutex_unlock(&p->mutex);
176:     pthread_mutex_lock(&p->mutex);
185:     pthread_mutex_unlock(&p->mutex);
63:     AvahiThreadedPoll *p = userdata;
78:     AvahiThreadedPoll *p;
80:     if (!(p = avahi_new(AvahiThreadedPoll, 1)))
github.com/googlegsa/sharepoint.v3:projects/ApacheHttpClient/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java:[master, ]
1046:         public Thread thread;
93:     private static ReferenceQueueThread REFERENCE_QUEUE_THREAD;
917:         public synchronized void notifyWaitingThread(HostConfiguration configuration) {
928:         public synchronized void notifyWaitingThread(HostConnectionPool hostPool) {
1044:     private static class WaitingThread {
1061:     private static class ReferenceQueueThread extends Thread {
1068:         public ReferenceQueueThread() {
65: public class MultiThreadedHttpConnectionManager implements HttpConnectionManager {
256:     public MultiThreadedHttpConnectionManager() {
706:         private LinkedList waitingThreads = new LinkedList();
1034:         public LinkedList waitingThreads = new LinkedList();
91:      * The thread responsible for handling lost connections.
134:             if (REFERENCE_QUEUE_THREAD != null) {
135:                 REFERENCE_QUEUE_THREAD.shutdown();
136:                 REFERENCE_QUEUE_THREAD = null;
171:             // start the reference queue thread if needed
172:             if (REFERENCE_QUEUE_THREAD == null) {
173:                 REFERENCE_QUEUE_THREAD = new ReferenceQueueThread();
174:                 REFERENCE_QUEUE_THREAD.start();
507:                             waitingThread.thread = Thread.currentThread();
531:                             // interrupted by an external thread.  Regardless we need to 
624:      * If another thread is blocked in getConnection() that could use this
741:                 waiter.thread.interrupt();
912:          * Notifies a waiting thread that a connection for the given configuration is 
922:          * Notifies a waiting thread that a connection for the given configuration is 
923:          * available.  This will wake a thread waiting in this host pool or if there is not
924:          * one a thread in the connection pool will be notified.
930:             // find the thread we are going to notify, we want to ensure that each
931:             // waiting thread is only interrupted once so we will remove it from 
937:                     LOG.debug("Notifying thread waiting on host pool, hostConfig=" 
944:                     LOG.debug("No-one waiting on host pool, notifying next waiting thread.");
954:                 waitingThread.thread.interrupt();
1041:      * A simple struct-like class to combine the waiting thread and the connection 
1045:         /** The thread that is waiting for a connection */
1048:         /** The connection pool the thread is waiting for */
1051:         /** Flag to indicate if the thread was interrupted by the ConnectionPool. Set
1053:          * before the thread is interrupted. */
1058:      * A thread for listening for HttpConnections reclaimed by the garbage
1066:          * Create an instance and make this a daemon thread.
105:      * MultiThreadedHttpConnectionManager. All static resources are released, all threads are 
453:             WaitingThread waitingThread = null;
492:                     // threads, so they avoid being sacrificed before necessary
504:                         if (waitingThread == null) {
505:                             waitingThread = new WaitingThread();
506:                             waitingThread.hostConnectionPool = hostPool;
509:                             waitingThread.interruptedByConnectionPool = false;
516:                         hostPool.waitingThreads.addLast(waitingThread);
517:                         connectionPool.waitingThreads.addLast(waitingThread);
520:                         if (!waitingThread.interruptedByConnectionPool) {
529:                         if (!waitingThread.interruptedByConnectionPool) {
533:                             hostPool.waitingThreads.remove(waitingThread);
534:                             connectionPool.waitingThreads.remove(waitingThread);
735:             // interrupt all waiting threads
738:                 WaitingThread waiter = (WaitingThread) iter.next();
777:          * connection counts and notifies waiting threads, if appropriate.
787:             notifyWaitingThread(config);
915:          * @see #notifyWaitingThread(HostConnectionPool)
918:             notifyWaitingThread(getHostPool(configuration));
933:             WaitingThread waitingThread = null;
940:                 waitingThread = (WaitingThread) hostPool.waitingThreads.removeFirst();
941:                 waitingThreads.remove(waitingThread);
946:                 waitingThread = (WaitingThread) waitingThreads.removeFirst();
947:                 waitingThread.hostConnectionPool.waitingThreads.remove(waitingThread);
949:                 LOG.debug("Notifying no-one, there are no waiting threads");
952:             if (waitingThread != null) {
953:                 waitingThread.interruptedByConnectionPool = true;
1004:                 notifyWaitingThread(hostPool);
1052:          * to true inside {@link ConnectionPool#notifyWaitingThread(HostConnectionPool)} 
1115:                     LOG.debug("ReferenceQueueThread interrupted", e);
2:  * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.java,v 1.47 2004/12/21 11:27:55 olegk Exp $
70:     private static final Log LOG = LogFactory.getLog(MultiThreadedHttpConnectionManager.class);
107:      * MultiThreadedHttpConnectionManager.
118:                 MultiThreadedHttpConnectionManager[]
119:                     connManagers = (MultiThreadedHttpConnectionManager[])
121:                         new MultiThreadedHttpConnectionManager
522:                             throw new IllegalThreadStateException(
523:                                 "Interrupted while waiting in MultiThreadedHttpConnectionManager");
705:         /** The list of WaitingThreads waiting for a connection */
736:             iter = waitingThreads.iterator();
764:             connection.getParams().setDefaults(MultiThreadedHttpConnectionManager.this.params);
765:             connection.setHttpConnectionManager(MultiThreadedHttpConnectionManager.this);
935:             if (hostPool.waitingThreads.size() > 0) {
942:             } else if (waitingThreads.size() > 0) {
1033:         /** The list of WaitingThreads for this host */
1070:             setName("MultiThreadedHttpConnectionManager cleanup");
github.com/google/j2objc:jre_emul/Classes/java/lang/Thread.java:[master, ]
52: public class Thread implements Runnable {
168:   private static final String THREAD = "Thread-";
188:   public Thread() {
202:   public Thread(Runnable runnable) {
217:   public Thread(Runnable runnable, String threadName) {
230:   public Thread(String threadName) {
250:   public Thread(ThreadGroup group, Runnable runnable) {
272:   public Thread(ThreadGroup group, Runnable runnable, String threadName, long stack) {
293:   public Thread(ThreadGroup group, Runnable runnable, String threadName) {
311:   public Thread(ThreadGroup group, String threadName) {
315:   private Thread(
56:   private final Object nativeThread;
58:   private final long threadId;
67:   ThreadLocal.ThreadLocalMap threadLocals = null;
74:   private ThreadGroup threadGroup;
88:   private static long threadOrdinalNum = 1;
177:   private static native Object newNativeThread() /*-[
368:   private static Thread createMainThread(Object nativeThread) {
385:   private static Thread createCurrentThread(Object nativeThread) {
389:   public static native Thread currentThread() /*-[
68:   ThreadLocal.ThreadLocalMap inheritableThreadLocals = null;
375:   private static native void initializeThreadClass() /*-[
528:   public ThreadGroup getThreadGroup() {
791:   private static synchronized long getNextThreadId() {
44:  * Simplified iOS version of java.lang.Thread, based on Apache Harmony source
45:  * (both luni-kernel and vmcore). This class uses pthread for thread creation
47:  * pthread's thread local mechanism (pthread_setspecific) is used to associate
48:  * this wrapper object with the current thread.
70:   /** The object the thread is waiting on (normally null). */
76:   /** the park state of the thread */
79:   /** The synchronization object responsible for this thread parking. */
86:    * Counter used to generate thread's ID
91:    * A representation of a thread's state. A given thread may only be in one
96:      * The thread has been created, but has never been started.
100:      * The thread may be run.
104:      * The thread is blocked and waiting for a lock.
108:      * The thread is waiting.
112:      * The thread is waiting for a specified amount of time.
116:      * The thread has been terminated.
135:     void uncaughtException(Thread t, Throwable e);
146:    * The maximum priority value allowed for a thread.
153:    * The minimum priority value allowed for a thread.
166:    * used to generate a default thread name
170:   // Milliseconds between polls for testing thread completion.
182:    * Constructs a new Thread with no runnable object and a newly generated
183:    * name. The new Thread will belong to the same ThreadGroup as the Thread
189:     this(null, null, THREAD, 0, null);
193:    * Constructs a new Thread with a runnable object and a newly generated
194:    * name. The new Thread will belong to the same ThreadGroup as the Thread
198:    *        be executed by the new Thread
203:     this(null, runnable, THREAD, 0, null);
207:    * Constructs a new Thread with a runnable object and name provided. The new
208:    * Thread will belong to the same ThreadGroup as the Thread calling this
212:    *        be executed by the new Thread
213:    * @param threadName Name for the Thread being created
222:    * Constructs a new Thread with no runnable object and the name provided.
223:    * The new Thread will belong to the same ThreadGroup as the Thread calling
226:    * @param threadName Name for the Thread being created
235:    * Constructs a new Thread with a runnable object and a newly generated
236:    * name. The new Thread will belong to the ThreadGroup passed as parameter.
238:    * @param group ThreadGroup to which the new Thread will belong
240:    *        be executed by the new Thread
251:     this(group, runnable, THREAD, 0, null);
255:    * Constructs a new Thread with a runnable object, the given name and
258:    * @param group ThreadGroup to which the new Thread will belong
260:    *        be executed by the new Thread
261:    * @param threadName Name for the Thread being created
277:    * Constructs a new Thread with a runnable object, the given name and
280:    * @param group ThreadGroup to which the new Thread will belong
282:    *        be executed by the new Thread
283:    * @param threadName Name for the Thread being created
298:    * Constructs a new Thread with no runnable object, the given name and
301:    * @param group ThreadGroup to which the new Thread will belong
302:    * @param threadName Name for the Thread being created
319:     if (name.equals(THREAD)) {
325:       // Thread is not yet started.
326:       Thread currentThread = currentThread();
333:       // Thread is already running.
342:   pthread_key_t java_thread_key;
345:     JavaLangThread *thread = (JavaLangThread *)javaThread;
346:     [thread exit];
347:     [thread release];
351:     JavaLangThread *thread = (JavaLangThread *)arg;
352:     pthread_setspecific(java_thread_key, thread);
355:         [thread run];
357:         [thread rethrowWithNSException:t];
359:         [thread rethrowWithNSException:[NSException exceptionWithName:@"Unknown error"
369:     return new Thread(ThreadGroup.mainThreadGroup, null, "main", 0, nativeThread);
373:    * Create a Thread wrapper around the main native thread.
376:     if (pthread_key_create(&java_thread_key, &javaThreadDestructor)) {
382:     pthread_setspecific(java_thread_key, [mainThread retain]);
386:     return new Thread(ThreadGroup.mainThreadGroup, null, THREAD, 0, nativeThread);
390:     JavaLangThread *thread = pthread_getspecific(java_thread_key);
391:     if (thread) {
392:       return thread;
396:     thread = JavaLangThread_createCurrentThreadWithId_(nt);
397:     pthread_setspecific(java_thread_key, [thread retain]);
398:     return thread;
403:       throw new IllegalThreadStateException("This thread was already started!");
465:    * stack for this Thread.
473:   public static int enumerate(Thread[] threads) {
474:     Thread thread = Thread.currentThread();
475:     return thread.getThreadGroup().enumerate(threads);
568:    * Posts an interrupt request to this {@code Thread}. Unless the caller is
572:    * the state of this {@code Thread}:
575:    * {@code Thread}s blocked in one of {@code Object}'s {@code wait()} methods
576:    * or one of {@code Thread}'s {@code join()} or {@code sleep()} methods will
580:    * {@code Thread}s blocked in an I/O operation of an
586:    * {@code Thread}s blocked in a {@link java.nio.channels.Selector} will have
595:    * @see Thread#interrupted
596:    * @see Thread#isInterrupted
618:    * Returns a <code>boolean</code> indicating whether the current Thread (
624:    * @see Thread#currentThread
625:    * @see Thread#interrupt
626:    * @see Thread#isInterrupted
629:     Thread currentThread = currentThread();
641:    * @see Thread#interrupt
642:    * @see Thread#interrupted
649:    * Blocks the current Thread (<code>Thread.currentThread()</code>) until
670:    * Blocks the current Thread (<code>Thread.currentThread()</code>) until
685:    * Blocks the current Thread (<code>Thread.currentThread()</code>) until
721:           // wait until this thread completes or the timeout has elapsed
771:           if (Thread.interrupted()) {
784:    * Causes the calling Thread to yield execution time to another Thread that
796:    * Indicates whether the current Thread has a monitor lock on the specified
800:    * @return true if the current thread has a monitor lock on the specified
808:    * Returns the context ClassLoader for this Thread.
824:       return "Thread[" + getName() + "," + getPriority() + "," + group.getName() + "]";
826:     return "Thread[" + getName() + "," + getPriority() + ",]";
830:    * Unparks this thread. This unblocks the thread it if it was
831:    * previously parked, or indicates that the thread is "preemptively
833:    * next time the thread is told to park, it will merely clear its
849:            * preemptively unparked thread is to remain in
869:    * Parks the current thread for a particular number of nanoseconds, or
870:    * indefinitely. If not indefinitely, this method unparks the thread
871:    * after the given number of nanoseconds if no other thread unparks it
872:    * first. If the thread has been "preemptively unparked," this method
874:    * also return spuriously (that is, without the thread being told to
881:    * thread.
927:    * Parks the current thread until the specified system time. This
928:    * method attempts to unpark the current thread immediately after
930:    * value, if no other thread unparks it first. If the thread has
933:    * spuriously (that is, without the thread being told to unpark
940:    * current thread.
942:    * @param time the time after which the thread should be unparked,
977:    * exception terminates a thread.
988:    * case any Thread dies due to an unhandled exception.
994:       Thread.defaultUncaughtHandler = handler;
998:    * Returns the handler invoked when this thread abruptly terminates
999:    * due to an uncaught exception. If this thread has not had an
1000:    * uncaught exception handler explicitly set then this thread's
1001:    * <tt>ThreadGroup</tt> object is returned, unless this thread
1011:    * Set the handler invoked when this thread abruptly terminates
1013:    * <p>A thread can take full control of how it responds to uncaught
1015:    * If no such handler is set then the thread's <tt>ThreadGroup</tt>
1017:    * @param eh the object to use as this thread's uncaught exception
1018:    * handler. If <tt>null</tt> then this thread has no explicit handler.
1019:    * @throws  SecurityException  if the current thread is not allowed to
1020:    *          modify this thread.
1032:     public synchronized void uncaughtException(Thread t, Throwable e) {
1033:       System.err.print("Exception in thread \"" + t.getName() + "\" ");
1039:    * Adds a runnable to be invoked upon interruption. If this thread has
1081:   public static Map<Thread,StackTraceElement[]> getAllStackTraces() {
1082:     return Collections.<Thread, StackTraceElement[]>emptyMap();
30: #import <pthread.h>
34: @interface NativeThread : NSObject {
36:   pthread_t t;
39: @implementation NativeThread
46:  * and maintains a pthread handle for using other pthread functionality.
55:   /** Android source declares this as the native VMThread class. */
160:    * The normal (default) priority value assigned to threads.
178:     return [[[NativeThread alloc] init] autorelease];
186:    * @see java.lang.ThreadGroup
199:    * @see java.lang.ThreadGroup
214:    * @see java.lang.ThreadGroup
218:     this(null, runnable, threadName, 0, null);
227:    * @see java.lang.ThreadGroup
231:     this(null, null, threadName, 0, null);
245:    * @see java.lang.ThreadGroup
256:    * belonging to the ThreadGroup passed as parameter.
267:    * @see java.lang.ThreadGroup
273:     this(group, runnable, threadName, stack, null);
278:    * belonging to the ThreadGroup passed as parameter.
288:    * @see java.lang.ThreadGroup
294:     this(group, runnable, threadName, 0, null);
299:    * belonging to the ThreadGroup passed as parameter.
307:    * @see java.lang.ThreadGroup
312:     this(group, null, threadName, 0, null);
316:       ThreadGroup group, Runnable runnable, String name, long stack, Object nativeThread) {
318:     this.threadId = getNextThreadId();
320:       name += threadId;
324:     if (nativeThread == null) {
327:       nativeThread = newNativeThread();
328:       this.priority = currentThread.getPriority();
330:         group = currentThread.getThreadGroup();
337:     this.threadGroup = group;
338:     this.nativeThread = nativeThread;
344:   void javaThreadDestructor(void *javaThread) {
377:       @throw create_JavaLangAssertionError_initWithId_(@"Failed to create pthread key.");
379:     NativeThread *nt = [[[NativeThread alloc] init] autorelease];
380:     nt->t = pthread_self();
381:     JavaLangThread *mainThread = JavaLangThread_createMainThreadWithId_(nt);
394:     NativeThread *nt = [[[NativeThread alloc] init] autorelease];
395:     nt->t = pthread_self();
405:     threadGroup.add(this);
414:     NativeThread *nt = (NativeThread *)self->nativeThread_;
415:     pthread_attr_t attr;
416:     pthread_attr_init(&attr);
418:     if (stack >= PTHREAD_STACK_MIN) {
419:       pthread_attr_setstacksize(&attr, stack);
421:     pthread_create(&nt->t, &attr, &start_routine, [self retain]);
426:     if (threadGroup != null) {
427:       threadGroup.threadTerminated(this);
428:       threadGroup = null;
452:       return currentThread().getThreadGroup().activeCount();
479:     return threadId;
499:     ThreadGroup g;
519:     param.sched_priority = (priority * 64 / JavaLangThread_MAX_PRIORITY) - 1;
520:     NativeThread *nt = (NativeThread *)self->nativeThread_;
521:     pthread_setschedparam(nt->t, SCHED_OTHER, &param);
529:     return state == State.TERMINATED ? null : threadGroup;
569:    * the {@link #currentThread()}, the method {@code checkAccess()} is called
599:     synchronized(nativeThread) {
619:    * <code>currentThread()</code>) has a pending interrupt request (<code>
630:     boolean result = currentThread.interrupted;
631:     currentThread.interrupted = false;
655:    * @see java.lang.ThreadDeath
662:       synchronized (nativeThread) {
664:               nativeThread.wait(POLL_INTERVAL);
678:    * @see java.lang.ThreadDeath
694:    * @see java.lang.ThreadDeath
713:       synchronized (nativeThread) {
725:                 nativeThread.wait(POLL_INTERVAL);
727:                 nativeThread.wait(millis, nanos);
777:       Object lock = currentThread().nativeThread;
788:     pthread_yield_np();
792:     return threadOrdinalNum++;
822:     ThreadGroup group = getThreadGroup();
842:     Object vmt = nativeThread;
890:     Object vmt = nativeThread;
948:     Object vmt = nativeThread;
1007:     return h != null ? h : threadGroup;
1022:    * @see ThreadGroup#uncaughtException
1078:    * Returns a map of stack traces for all live threads.
1087:     stop(new ThreadDeath());
174:     initializeThreadClass();
243:    * @throws IllegalThreadStateException if <code>group.destroy()</code> has
265:    * @throws IllegalThreadStateException if <code>group.destroy()</code> has
286:    * @throws IllegalThreadStateException if <code>group.destroy()</code> has
305:    * @throws IllegalThreadStateException if <code>group.destroy()</code> has
504:     if ((g = getThreadGroup()) != null) {
android.googlesource.com/platform/external/nist-sip:java/gov/nist/core/ThreadAuditor.java:[master, ]
36:         private Thread thread;
23: public class ThreadAuditor {
25:     private Map<Thread,ThreadHandle> threadHandles = new HashMap<Thread,ThreadHandle>();
31:     public class ThreadHandle {
39:         private ThreadAuditor threadAuditor;
42:         public ThreadHandle(ThreadAuditor aThreadAuditor) {
59:         public Thread getThread() {
102:     public synchronized ThreadHandle addCurrentThread() {
113:     public synchronized void removeThread(Thread thread) {
33:         private boolean isThreadActive;
49:         public boolean isThreadActive() {
54:         protected void setThreadActive(boolean value) {
132:     public synchronized String auditThreads() {
6:  * Thread Auditor class:
15:  *     the thread can periodically ping the auditor.
32:         /// Set to true when the thread pings, periodically reset to false by the auditor
35:         /// Thread being monitored
38:         /// Thread auditor monitoring this thread
44:             thread = Thread.currentThread();
48:         /// Called by the auditor thread to check the ping status of the thread
53:         /// Called by the auditor thread to reset the ping status of the thread
58:         /// Return the thread being monitored
60:             return thread;
80:                     .append("Thread Name: ").append(thread.getName())
81:                     .append(", Alive: ").append(thread.isAlive());
86:     /// Indicates how often monitored threads are supposed to ping (0 = no thread monitoring)
101:     /// Called by a thread that wants to be monitored
103:         // Create and return a thread handle but only add it
107:             threadHandles.put(Thread.currentThread(), threadHandle);
112:     /// Stops monitoring a given thread
114:         threadHandles.remove(thread);
117:     /// Called by a monitored thread reporting that it's alive and well
141:                 // Get the non-responsive thread
142:                 Thread thread = threadHandle.getThread();
146:                     auditReport = "Thread Auditor Report:\n";
148:                 auditReport += "   Thread [" + thread.getName() + "] has failed to respond to an audit request.\n";
156:                 //      stackTraces = Thread.getAllStackTraces();
159:                 //  // Get the stack trace for the non-responsive thread
160:                 //  StackTraceElement[] stackTraceElements = (StackTraceElement[])stackTraces.get(thread);
173:             // Reset the ping status of the thread
185:         String toString = "Thread Auditor - List of monitored threads:\n";
7:  *   - Provides a mechanism for applications to check the health of internal threads
9:  *   - Threads register with the auditor at startup and "ping" the auditor every so often.
11:  *     auditor reports if the threads are healthy or if any of them failed to ping and are
13:  *   - The main implication for the monitored threads is that they can no longer block
24:     /// Threads being monitored
27:     /// How often are threads supposed to ping
30:     /// Internal class, used as a handle by the monitored threads
45:             threadAuditor = aThreadAuditor;
63:         // Helper function to allow threads to ping using this handle
65:             threadAuditor.ping(this);
68:         // Helper function to allow threads to get the ping interval directly from this handle
70:             return threadAuditor.getPingIntervalInMillisecs();
91:     /// Defines how often monitored threads are supposed to ping
96:     /// Indicates if the auditing of threads is enabled
104:         // to the list of monitored threads if the auditor is enabled
105:         ThreadHandle threadHandle = new ThreadHandle(this);
109:         return threadHandle;
118:     public synchronized void ping(ThreadHandle threadHandle) {
119:         threadHandle.setThreadActive(true);
124:         threadHandles.clear();
128:      * Audits the sanity of all threads
136:         // Scan all monitored threads looking for non-responsive ones
137:         Iterator<ThreadHandle> it = threadHandles.values().iterator();
139:             ThreadHandle threadHandle = (ThreadHandle) it.next();
140:             if (!threadHandle.isThreadActive()) {
154:                 //  // Get stack traces for all live threads (do this only once per audit)
174:             threadHandle.setThreadActive(false);
186:         Iterator<ThreadHandle> it = threadHandles.values().iterator();
188:             ThreadHandle threadHandle = (ThreadHandle)it.next();
189:             toString += "   " + threadHandle.toString() + "\n";
43:             isThreadActive = false;
50:             return isThreadActive;
55:             isThreadActive = value;
github.com/fuchsia-mirror/third_party-skia:dm/DM.cpp:[master, ]
124:     SkThreadID thread;
1265: SkThread* start_status_thread() {
1039: static SkTaskGroup gDefinitelyThreadSafeWork;
181:         if (task.thread == thisThread) {
1020: static bool match(const char* needle, const char* haystack) {
1021:     return 0 == strcmp("_", needle) || nullptr != strstr(haystack, needle);
1038: // .png encoding are definitely thread safe.  This lets us offload that work to CPU threads.
1266:     auto thread = new SkThread([] (void*) {
1276:     thread->start();
1277:     return thread;
1335:     std::unique_ptr<SkThread> statusThread(start_status_thread());
1362:     // With the parallel work running, run serial tasks and tests here on main thread.
62: DEFINE_bool(gpu_threading, false, "Allow GPU work to run on multiple threads?");
179:     SkThreadID thisThread = SkGetThreadID();
855:                                sk_ref_sp(gpuConfig->getColorSpace()), FLAGS_gpu_threading);
1037: // Even when a Task Sink reports to be non-threadsafe (e.g. GPU), we know things like
1080:             // We're likely switching threads here, so we must capture by value, [=] or [foo,bar].
1234:             (FLAGS_gpu_threading ? gParallelTests : gSerialTests).push(test);
1312:     SkTaskGroup::Enabler enabled(FLAGS_threads);
1375:     // At this point we're back in single-threaded land.
33: #include "SkThreadUtils.h"
161:     gRunning.push_back({id,SkGetThreadID()});
1082:             gDefinitelyThreadSafeWork.add([task,name,bitmap,data]{
1368:     gDefinitelyThreadSafeWork.wait();
github.com/google/skia:dm/DM.cpp:[master, ]
130:     SkThreadID thread;
1297: SkThread* start_status_thread() {
1073: static SkTaskGroup gDefinitelyThreadSafeWork;
187:         if (task.thread == thisThread) {
1054: static bool match(const char* needle, const char* haystack) {
1055:     return 0 == strcmp("_", needle) || nullptr != strstr(haystack, needle);
1072: // .png encoding are definitely thread safe.  This lets us offload that work to CPU threads.
1298:     auto thread = new SkThread([] (void*) {
1308:     thread->start();
1309:     return thread;
1377:     std::unique_ptr<SkThread> statusThread(start_status_thread());
1404:     // With the parallel work running, run serial tasks and tests here on main thread.
64: DEFINE_bool(gpu_threading, false, "Allow GPU work to run on multiple threads?");
185:     SkThreadID thisThread = SkGetThreadID();
869:                                sk_ref_sp(gpuConfig->getColorSpace()), FLAGS_gpu_threading);
1071: // Even when a Task Sink reports to be non-threadsafe (e.g. GPU), we know things like
1114:             // We're likely switching threads here, so we must capture by value, [=] or [foo,bar].
1266:             (FLAGS_gpu_threading ? gParallelTests : gSerialTests).push(test);
1354:     SkTaskGroup::Enabler enabled(FLAGS_threads);
1417:     // At this point we're back in single-threaded land.
34: #include "SkThreadUtils.h"
167:     gRunning.push_back({id,SkGetThreadID()});
1116:             gDefinitelyThreadSafeWork.add([task,name,bitmap,data]{
1410:     gDefinitelyThreadSafeWork.wait();
chromium.googlesource.com/skia:dm/DM.cpp:[master, ]
duplicate result
github.com/google/perf_data_converter:third_party/chromiumos-wide-profiling/compat/ext/detail/thread.h:[master, ]
15: class Thread : public quipper::compat::ThreadInterface {
17:   explicit Thread(const string& name_prefix) {}
35:   std::thread thread_;
6: #define CHROMIUMOS_WIDE_PROFILING_COMPAT_EXT_DETAIL_THREAD_H_
5: #ifndef CHROMIUMOS_WIDE_PROFILING_COMPAT_EXT_DETAIL_THREAD_H_
11: #include <thread>
20:     thread_ = std::thread(&Thread::Run, this);
24:     thread_.join();
28:     return thread_.native_handle();
62: #endif  // CHROMIUMOS_WIDE_PROFILING_COMPAT_EXT_DETAIL_THREAD_H_
github.com/google/perf_data_converter:third_party/chromiumos-wide-profiling/compat/cros/detail/thread.h:[master, ]
13: class Thread : public quipper::compat::ThreadInterface,
16:   explicit Thread(const string& name_prefix) : thread_(this, name_prefix) {}
34:   base::DelegateSimpleThread thread_;
6: #define CHROMIUMOS_WIDE_PROFILING_COMPAT_CROS_DETAIL_THREAD_H_
5: #ifndef CHROMIUMOS_WIDE_PROFILING_COMPAT_CROS_DETAIL_THREAD_H_
9: #include "base/threading/simple_thread.h"
19:     thread_.Start();
23:     thread_.Join();
27:     return thread_.tid();
61: #endif  // CHROMIUMOS_WIDE_PROFILING_COMPAT_CROS_DETAIL_THREAD_H_
14:                public base::DelegateSimpleThread::Delegate {
github.com/google/gapid:core/cc/thread.h:[master, ]
26: class Thread {
40: inline Thread::Thread(uint64_t id) : mId(id) {}
18: #define CORE_THREAD_H
17: #ifndef CORE_THREAD_H
25: // Thread represents a single thread of execution in the process.
28:     // current returns the Thread representing the current thread of execution.
29:     static Thread current();
31:     // id returns the process-unique identifier for the Thread.
35:     inline Thread(uint64_t id);
42: inline uint64_t Thread::id() const {
49:         ~AsyncJob(); // Waits on the thread to finish.
57:     void* _; // A pointer to the OS thread object.
62: #endif  // CORE_THREAD_H
github.com/google/swiftshader:src/Common/Thread.cpp:[master, ]
19: 	Thread::Thread(void (*threadFunction)(void *parameters), void *parameters)
33: 	Thread::~Thread()
15: #include "Thread.hpp"
38: 	void Thread::join()
54: 		unsigned long __stdcall Thread::startFunction(void *parameters)
62: 		void *Thread::startFunction(void *parameters)
22: 		Entry entry = {threadFunction, parameters, &init};
25: 			handle = CreateThread(NULL, 1024 * 1024, startFunction, &entry, 0, NULL);
27: 			pthread_create(&handle, NULL, startFunction, &entry);
35: 		join();   // Make threads exit before deleting them to not block here
46: 				pthread_join(handle, NULL);
58: 			entry.threadFunction(entry.threadParameters);
66: 			entry.threadFunction(entry.threadParameters);
76: 			pthread_cond_init(&handle, NULL);
77: 			pthread_mutex_init(&mutex, NULL);
87: 			pthread_cond_destroy(&handle);
88: 			pthread_mutex_destroy(&mutex);
android.googlesource.com/platform/external/swiftshader:src/Common/Thread.cpp:[master, ]
19: 	Thread::Thread(void (*threadFunction)(void *parameters), void *parameters)
33: 	Thread::~Thread()
15: #include "Thread.hpp"
38: 	void Thread::join()
48: 		unsigned long __stdcall Thread::startFunction(void *parameters)
56: 		void *Thread::startFunction(void *parameters)
22: 		Entry entry = {threadFunction, parameters, &init};
25: 			handle = CreateThread(0, 1024 * 1024, startFunction, &entry, 0, 0);
27: 			pthread_create(&handle, 0, startFunction, &entry);
35: 		join();   // Make threads exit before deleting them to not block here
43: 			pthread_join(handle, 0);
52: 			entry.threadFunction(entry.threadParameters);
60: 			entry.threadFunction(entry.threadParameters);
70: 			pthread_cond_init(&handle, 0);
71: 			pthread_mutex_init(&mutex, 0);
81: 			pthread_cond_destroy(&handle);
82: 			pthread_mutex_destroy(&mutex);
gerrit.googlesource.com/prolog-cafe:src/repl/BlockingPrologControl.java:[master, ]
108:   private volatile Thread thread;
9:  * Prolog thread.<br>
68:  *      Thread.sleep(10);
89:  *          Thread.sleep(100);
107:   /** A volatile instance variable holding a thread. */
128:    * allocates a new <code>Thread</code> object, and start the execution of the given goal.
129:    * And then it stops the thread and returns <code>true</code>
144:    * allocates a new <code>Thread</code> object, and start the execution of the given goal.
145:    * And then it stops the thread and returns <code>true</code>
151:   thread = new Thread(this);
152:   thread.setName("Prolog-" + p.toString());
153:   thread.start(); // execute run() in new thread.
155:       wait();     // wait caller's thread.
166:    * initilizes the Prolog engine, allocates a new <code>Thread</code> object,
201:    * Finally, while the <code>thread</code> is not <code>null</code> and
203:    * it waits until another thread invokes the <code>notify()</code> method
207:    * @see #thread
214:   while (thread != null && resultReady) {
229:    * Finally, while the <code>thread</code> is not <code>null</code> and
231:    * it waits until another thread invokes the <code>notify()</code> method
235:    * @see #thread
242:   while (thread != null && resultReady) {
252:     return thread == null;
255:   /** Waits for this thread to die. */
257:   while (thread != null && ! resultReady) {
266:    * Forces the thread to stop.<br>
268:    * This method first sets the <code>resultReady</code> and <code>thread</code>
272:    * @see #thread
276:   thread = null;
281:    * Forces the thread to start the execution.<br>
284:    * allocates a new <code>Thread</code> object, and start the execution.
285:    * The Java Virtual Machine calls the <code>run</code> method of this thread.
290:   thread = new Thread(this);
291:   thread.start();
295:    * Forces the thread to continue the execution.<br>
340:    * This method first waits until another thread invokes the <code>notify()</code>
342:    * while the <code>thread</code> is not <code>null</code> and
348:    * @see #thread
351:   while (thread != null && ! resultReady) {
183:    * and wakes up all threads that are waiting on this object's monitor.
200:    * And then it wakes up all threads that are waiting by <code>notifyAll()</code>.
228:    * And then it wakes up all threads that are waiting by <code>notifyAll()</code>.
270:    * And then it wakes up all threads that are waiting by <code>notifyAll()</code>.
298:    * and then wakes up all threads that are waiting by <code>notifyAll()</code>.
github.com/google/mtail:vm/vm.go:[master, ]
133: type thread struct {
144: // expressions), mutable state (metrics), and a stack for the current thread of
156: 	t *thread // Current thread of execution
166: func (t *thread) Push(value interface{}) {
171: func (t *thread) Pop() (value interface{}) {
193: 	glog.Infof("Thread:")
213: func (t *thread) PopInt() (int64, error) {
234: func (t *thread) PopFloat() (float64, error) {
254: // instruction, and returns a boolean indicating if the current thread should
256: func (v *VM) execute(t *thread, i instr) {
569: 	t := new(thread)
github.com/google/gtm-oauth2:Source/GTMOAuth2Authentication.m:[master, ]
104: @property (atomic, retain) NSThread *thread;
96:   NSThread *thread_;
111:                                          thread:(NSThread *)thread;
120:             thread = thread_,
127:                                          thread:(NSThread *)thread {
134:   obj.thread = thread;
142:   [thread_ release];
356:                                               thread:[NSThread currentThread]];
380:                                               thread:[NSThread currentThread]];
572:   // Invoke any callbacks on the proper thread
574:     NSThread *targetThread = args.thread;
580:       // (or if it's nil, we'll use the main thread) for callbacks.
597:         // if that's available, else we'll hope the original thread has a spinning run loop.
656:                                               thread:[NSThread currentThread]];
575:     BOOL isSameThread = [targetThread isEqual:[NSThread currentThread]];
576:     if (isSameThread) {
608:                        onThread:targetThread
github.com/google/arithmancer:third_party/werkzeug/serving.py:[master, ]
50:     import _thread as thread
401:     multithread = False
453: class ThreadedWSGIServer(ThreadingMixIn, BaseWSGIServer):
455:     multithread = True
48:     import thread
508:     """When this function is run from the main thread, it will force other
585:     but running the reloader thread.
611:         thread.start_new_thread(main_func, ())
661:                      thread?
53:     from SocketServer import ThreadingMixIn, ForkingMixIn
56:     from socketserver import ThreadingMixIn, ForkingMixIn
88:             'wsgi.multithread':     self.server.multithread,
400:     """Simple single-threaded, single-process WSGI server."""
454:     """A WSGI server that does threading."""
469: def make_server(host, port, app=None, threaded=False, processes=1,
472:     """Create a new server instance that is either threaded, or forks
475:     if threaded and processes > 1:
478:     elif threaded:
479:         return ThreadedWSGIServer(host, port, app, request_handler,
509:     threads to exit when any modules currently loaded change.
624:                extra_files=None, reloader_interval=1, threaded=False,
660:     :param threaded: should the process handle each request in a separate
690:         make_server(hostname, port, application, threaded,
476:         raise ValueError("cannot have a multithreaded and "
628:     wraps `wsgiref` to fix the wrong default reporting of the multithreaded
629:     WSGI variable and adds optional multithreading and fork support.
github.com/foam-framework/foam:lib/gmail/SchemaImport.js:[master, ]
503:   "Thread": {
323:     "threads": {
380:     "threadId": {
1463:     "threads": {
309:   "ListThreadsResponse": {
482:   "ModifyThreadRequest": {
214:      "description": "The owner type for the label. User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. System labels are internally created and cannot be added, modified, or deleted. System labels may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the INBOX and UNREAD labels from messages and threads, but cannot apply or remove the DRAFTS or SENT labels from messages or threads.",
327:       "$ref": "Thread"
382:      "description": "The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: \n- The requested threadId must be specified on the Message or Draft.Message you supply with your request. \n- The References and In-Reply-To headers must be set in compliance with the \u003ca href=\"https://tools.ietf.org/html/rfc2822\"RFC 2822 standard. \n- The Subject headers must match."
489:      "description": "A list of IDs of labels to add to this thread.",
496:      "description": "A list of IDs of labels to remove from this thread.",
504:    "id": "Thread",
507:    "externalTypeName": "caribou.api.proto.Thread",
511:      "description": "The ID of the last history record that modified this thread.",
516:      "description": "The unique ID of the thread."
520:      "description": "The list of messages in the thread.",
830:          "description": "Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request.",
1469:        "description": "Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.",
1473:          "description": "ID of the Thread to delete.",
1497:        "description": "Gets the specified thread.",
1501:          "description": "The ID of the thread to retrieve.",
1518:         "$ref": "Thread"
1585:        "description": "Modifies the labels applied to the thread. This applies to all messages in the thread.",
1589:          "description": "The ID of the thread to modify.",
1609:         "$ref": "Thread"
1620:        "description": "Moves the specified thread to the trash.",
1624:          "description": "The ID of the thread to Trash.",
1641:         "$ref": "Thread"
1652:        "description": "Removes the specified thread from the trash.",
1656:          "description": "The ID of the thread to remove from Trash.",
1673:         "$ref": "Thread"
1738:    GMailSchema.schemas.Thread
152:    "description": "Labels are used to categorize messages and threads within the user's mailbox.",
325:      "description": "List of threads.",
890:        "description": "Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.",
1466:        "id": "gmail.users.threads.delete",
1467:        "path": "{userId}/threads/{id}",
1494:        "id": "gmail.users.threads.get",
1495:        "path": "{userId}/threads/{id}",
1527:        "id": "gmail.users.threads.list",
1528:        "path": "{userId}/threads",
1530:        "description": "Lists the threads in the user's mailbox.",
1534:          "description": "Include threads from SPAM and TRASH in the results.",
1540:          "description": "Only return threads with labels that match all of the specified label IDs.",
1546:          "description": "Maximum number of threads to return.",
1558:          "description": "Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\".",
1582:        "id": "gmail.users.threads.modify",
1583:        "path": "{userId}/threads/{id}/modify",
1617:        "id": "gmail.users.threads.trash",
1618:        "path": "{userId}/threads/{id}/trash",
1649:        "id": "gmail.users.threads.untrash",
1650:        "path": "{userId}/threads/{id}/untrash",
1746:   'threads'
310:    "id": "ListThreadsResponse",
312:    "externalTypeName": "caribou.api.proto.ListThreadsResponse",
483:    "id": "ModifyThreadRequest",
485:    "externalTypeName": "caribou.api.proto.ModifyThreadRequest",
1573:         "$ref": "ListThreadsResponse"
1606:         "$ref": "ModifyThreadRequest"
android.googlesource.com/platform/build/soong:ui/build/context.go:[master, ]
67: 	Thread tracer.Thread
74: 		c.Tracer.Begin(name, c.Thread)
81: 		c.Tracer.End(c.Thread)
88: 		c.Tracer.Complete(name, c.Thread, begin, end)
95: 		c.Tracer.ImportNinjaLog(c.Thread, filename, startOffset)
github.com/googlearchive/appengine-try-python-flask:lib/werkzeug/serving.py:[master, ]
duplicate result
github.com/GoogleCloudPlatform/deepbreath:third_party/gmail.js:[master, ]
2597:   api.dom.thread = function(element) {
155:   api.check.is_thread = function() {
1195:       'view_thread': {
732:                       'toggle_threads'  : 'toggle_threads'
704:                       'dm'          : 'delete_message_in_thread',
730:                       'rtr'         : 'restore_message_in_thread',
1190:     api.tracker.supported_observers = ['view_thread', 'view_email', 'load_email_menu', 'recipient_change', 'compose'];
1193:       // when a thread is clicked on in a mailbox for viewing - note: this should fire at a similar time (directly after) as the open_email XHR observer
1199:           match = new api.dom.thread(match);
1202:           // look for any email elements in this thread that are currently displaying
1206:             api.observe.trigger_dom('view_email', email, api.tracker.dom_observers.view_thread.sub_observers.view_email.handler);
1211:           // when an individual email is loaded within a thread (also fires when thread loads displaying the latest email)
1804:         data.thread_id = x[1];
2434:     An object for interacting with an email currently present in the DOM. Represents an individual email message within a thread
2550:         // retrieve & cache the data for this whole thread of emails
2593:     An object for interacting with an email currently present in the DOM. Represents a conversation thread
2595:     Expects a jQuery DOM element for the thread wrapper div (div.if as returned by the 'view_thread' observer)
2598:     if (!element || (!element.hasClass('if'))) api.tools.error('api.dom.thread called with invalid element/id');
2603:   $.extend(api.dom.thread.prototype, {
337:       return Object.keys(data.threads);
817:       if(api.observe.bound('toggle_threads')) {
818:         triggered.toggle_threads = response;
825:         if(api.observe.bound('toggle_threads')) {
826:           triggered.toggle_threads = response;
1799:     var threads = {};
1808:         data.total_threads = x[8];
1814:         if(data.threads == undefined) {
1815:           data.threads = {};
1818:         data.threads[x[1]] = {};
1819:         data.threads[x[1]].is_deleted = x[13] == undefined;
1820:         data.threads[x[1]].reply_to_id = x[2];
1821:         data.threads[x[1]].from = x[5];
1822:         data.threads[x[1]].from_email = x[6];
1823:         data.threads[x[1]].timestamp = x[7];
1824:         data.threads[x[1]].datetime = x[24];
1825:         data.threads[x[1]].attachments = x[21].split(',');
1826:         data.threads[x[1]].subject = x[12];
1827:         data.threads[x[1]].content_html = (x[13] != undefined) ? x[13][6] : x[8];
1828:         data.threads[x[1]].to = (x[13] != undefined) ? x[13][1] : ((x[37] != undefined) ? x[37][1]:[]);
1829:         data.threads[x[1]].cc = (x[13] != undefined) ? x[13][2] : [];
1830:         data.threads[x[1]].bcc = (x[13] != undefined) ? x[13][3] : [];
1831:         data.threads[x[1]].reply_to = api.tools.get_reply_to(x[13]);
1834:           data.threads[x[1]].content_plain = (x[13] != undefined) ? $(x[13][6]).text() : x[8];
1837:           data.threads[x[1]].content_plain = (x[13] != undefined) ? x[13][6] : x[8];
1958:       var threads = displayed_email_data.threads;
1959:       var total_threads = displayed_email_data.total_threads;
1964:       for (var id in threads) {
1965:         var email = threads[id];
1969:           delete threads[id];
1970:           total_threads.splice(total_threads.indexOf(id), 1);
1977:       for (id in email_data.threads) {
1982:           var email = email_data.threads[id];
1988:           displayed_email_data.threads = {};
1989:           displayed_email_data.threads[id] = email;
1991:           displayed_email_data.total_threads = [id];
2552:         $.each(data.threads, function(email_id, email_data) {
github.com/GoogleChrome/chrome-app-samples:samples/text-editor/lib/ace/mode/text.js:[master, ]
135:             needle: needle
117:         var needle = line.substring(Math.max(startOuter, 0),
121:         if ((startOuter >= 0 && /^[\w\d]/.test(needle)) ||
122:             (endOuter <= lineCols && /[\w\d]$/.test(needle)))
125:         needle = line.substring(selection.start.column, selection.end.column);
126:         if (!/^[\w\d]+$/.test(needle))
go.googlesource.com/debug:macho/macho.go:[master, ]
226: type Thread struct {
74: 	LoadCmdThread     LoadCmd = 4
75: 	LoadCmdUnixThread LoadCmd = 5 // thread+stack
225: // A Thread is a Mach-O thread state command.
84: 	{uint32(LoadCmdThread), "LoadCmdThread"},
85: 	{uint32(LoadCmdUnixThread), "LoadCmdUnixThread"},
chromium.googlesource.com/chromiumos/third_party/modemmanager-next:plugins/tests/test-port-context.c:[master, ]
26:     GThread *thread;
342: port_context_thread_func (TestPortContext *self)
310:     /* Signal that the thread is ready */
329:     g_assert (self->thread != NULL);
333:     /* Cancel main loop of the port context thread, by scheduling an idle task
334:      * in the thread-owned main context */
337:     g_thread_join (self->thread);
338:     self->thread = NULL;
347:     /* Define main context and loop for the thread */
350:     g_main_context_push_thread_default (self->context);
352:     /* Once the thread default context is setup, launch service */
367:     g_assert (self->thread == NULL);
368:     self->thread = g_thread_new (self->name,
369:                                  (GThreadFunc)port_context_thread_func,
372:     /* Now wait until the thread has finished its initialization and is
385:     g_assert (self->thread == NULL);
github.com/fuchsia-mirror/magenta-rs:src/lib.rs:[master, ]
24: mod thread;
250:     Thread = 2,
510:     fn thread_time_increases() {
35: pub use thread::Thread;
210:         // Task signals (process, thread, job)
248:     /// The number of nanoseconds the current thread has been running for. Corresponds to
249:     /// MX_CLOCK_THREAD.
511:         let time1 = time_get(ClockId::Thread);
512:         let time2 = time_get(ClockId::Thread);
github.com/googlearchive/cloud-playground:lib/werkzeug/serving.py:[master, ]
duplicate result
github.com/googlearchive/solutions-mobile-shopping-assistant-ios-client:GTLSource/GTMHTTPFetcher.h:[master, ]
545: @property (retain) NSThread *thread;
463:   NSThread *thread_;
82: // Callbacks require either that the thread used to start the fetcher have a run
83: // loop spinning (typically the main thread), or that an NSOperationQueue be
86: // callbacks on a background thread:
90: // or specify the main queue for callbacks on the main thread:
543: // The thread used to run this fetcher in the fetcher service when no operation
80: // Threading and queue support:
github.com/GoogleChrome/chrome-app-samples:samples/text-editor/lib/ace/editor_highlight_selected_word_test.js:[master, ]
139:             needle: "Mauris"
194:             needle: "consectetur"
chromium.googlesource.com/chromiumos/third_party/minifakedns:src/miniFakeDns.py:[master, ]
100:   thread = threading.Thread(target=server.run, args=(stopper,))
72:     thread = threading.Thread(target=server.run, args=(stopper,))
102:     thread.start()
106:     print 'stopping thread'
108:   thread.join()
3: import logging, socket, threading, time
67:     """Runs DNSServer until the threading.Event object |stop| gets set.
71:     stopper = threading.Event()
99:   stopper = threading.Event()
github.com/GoogleCloudPlatform/appengine-endpoints-tictactoe-ios:TicTacToeSample/GTMHTTPFetcher.h:[master, ]
duplicate result
github.com/google/kythe:third_party/leveldb/db/db_bench.cc:[master, ]
535:     ThreadState* thread;
288: struct ThreadState {
294:   ThreadState(int index)
532:   struct ThreadArg {
539:   static void ThreadBody(void* v) {
70: static int FLAGS_threads = 1;
196:     // Just keep the messages from one thread
246:       // Rate is computed on actual elapsed time, not the sum of per-thread
274:   // Each thread goes through the following states:
287: // Per-thread state for concurrent executions of the same benchmark.
488:         num_threads++;  // Add extra thread for writing
542:     ThreadState* thread = arg->thread;
554:     thread->stats.Start();
555:     (arg->bm->*(arg->method))(thread);
556:     thread->stats.Stop();
580:       arg[i].thread = new ThreadState(i);
581:       arg[i].thread->shared = &shared;
598:       arg[0].thread->stats.Merge(arg[i].thread->stats);
600:     arg[0].thread->stats.Report(name);
603:       delete arg[i].thread;
608:   void Crc32c(ThreadState* thread) {
617:       thread->stats.FinishedSingleOp();
623:     thread->stats.AddBytes(bytes);
624:     thread->stats.AddMessage(label);
627:   void AcquireLoad(ThreadState* thread) {
632:     thread->stats.AddMessage("(each op is 1000 loads)");
638:       thread->stats.FinishedSingleOp();
643:   void SnappyCompress(ThreadState* thread) {
654:       thread->stats.FinishedSingleOp();
658:       thread->stats.AddMessage("(snappy failure)");
663:       thread->stats.AddMessage(buf);
664:       thread->stats.AddBytes(bytes);
668:   void SnappyUncompress(ThreadState* thread) {
679:       thread->stats.FinishedSingleOp();
684:       thread->stats.AddMessage("(snappy failure)");
686:       thread->stats.AddBytes(bytes);
705:   void WriteSeq(ThreadState* thread) {
706:     DoWrite(thread, true);
709:   void WriteRandom(ThreadState* thread) {
710:     DoWrite(thread, false);
713:   void DoWrite(ThreadState* thread, bool seq) {
717:       thread->stats.AddMessage(msg);
727:         const int k = seq ? i+j : (thread->rand.Next() % FLAGS_num);
732:         thread->stats.FinishedSingleOp();
740:     thread->stats.AddBytes(bytes);
743:   void ReadSequential(ThreadState* thread) {
749:       thread->stats.FinishedSingleOp();
753:     thread->stats.AddBytes(bytes);
756:   void ReadReverse(ThreadState* thread) {
762:       thread->stats.FinishedSingleOp();
766:     thread->stats.AddBytes(bytes);
769:   void ReadRandom(ThreadState* thread) {
775:       const int k = thread->rand.Next() % FLAGS_num;
780:       thread->stats.FinishedSingleOp();
784:     thread->stats.AddMessage(msg);
787:   void ReadMissing(ThreadState* thread) {
792:       const int k = thread->rand.Next() % FLAGS_num;
795:       thread->stats.FinishedSingleOp();
799:   void ReadHot(ThreadState* thread) {
805:       const int k = thread->rand.Next() % range;
808:       thread->stats.FinishedSingleOp();
812:   void SeekRandom(ThreadState* thread) {
819:       const int k = thread->rand.Next() % FLAGS_num;
824:       thread->stats.FinishedSingleOp();
828:     thread->stats.AddMessage(msg);
831:   void DoDelete(ThreadState* thread, bool seq) {
838:         const int k = seq ? i+j : (thread->rand.Next() % FLAGS_num);
842:         thread->stats.FinishedSingleOp();
852:   void DeleteSeq(ThreadState* thread) {
853:     DoDelete(thread, true);
856:   void DeleteRandom(ThreadState* thread) {
857:     DoDelete(thread, false);
860:   void ReadWhileWriting(ThreadState* thread) {
861:     if (thread->tid > 0) {
862:       ReadRandom(thread);
864:       // Special thread that keeps writing until other threads are done.
868:           MutexLock l(&thread->shared->mu);
869:           if (thread->shared->num_done + 1 >= thread->shared->num_initialized) {
875:         const int k = thread->rand.Next() % FLAGS_num;
886:       thread->stats.Start();
890:   void Compact(ThreadState* thread) {
69: // Number of concurrent threads to run.
289:   int tid;             // 0..n-1 when running in n threads
290:   Random rand;         // Has different seeds for different threads
441:       void (Benchmark::*method)(ThreadState*) = NULL;
443:       int num_threads = FLAGS_threads;
526:         RunBenchmark(num_threads, name, method);
536:     void (Benchmark::*method)(ThreadState*);
540:     ThreadArg* arg = reinterpret_cast<ThreadArg*>(v);
568:                     void (Benchmark::*method)(ThreadState*)) {
575:     ThreadArg* arg = new ThreadArg[n];
582:       Env::Default()->StartThread(ThreadBody, &arg[i]);
870:             // Other threads have finished
949:     } else if (sscanf(argv[i], "--threads=%d%c", &n, &junk) == 1) {
950:       FLAGS_threads = n;
github.com/googlearchive/solutions-mobile-backend-starter-ios-client:gtl/GTMHTTPFetcher.h:[master, ]
559: @property (retain) NSThread *thread;
474:   NSThread *thread_;
82: // Callbacks require either that the thread used to start the fetcher have a run
83: // loop spinning (typically the main thread), or that an NSOperationQueue be
86: // callbacks on a background thread:
92: // or specify the main queue for callbacks on the main thread:
557: // The thread used to run this fetcher in the fetcher service when no operation
80: // Threading and queue support:
github.com/MobileChromeApps/cordova-plugin-google-open-source-ios:GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcher.h:[master, ]
637: @property (retain) NSThread *thread;
534:   NSThread *thread_;
82: // Callbacks require either that the thread used to start the fetcher have a run
83: // loop spinning (typically the main thread), or that an NSOperationQueue be
86: // callbacks on a background thread:
92: // or specify the main queue for callbacks on the main thread:
635: // The thread used to run this fetcher in the fetcher service when no operation
814: // not supplied, and the fetcher is started off of the main thread, then a
80: // Threading and queue support:
github.com/fuchsia-mirror/fidl:compiler/legacy_generators/pylib/mojom/generate/module.py:[master, ]
112: THREAD                = ReferenceKind('h:t')
125: NULLABLE_THREAD       = ReferenceKind('?h:t', True)
533: def IsThreadKind(kind):
51:     if self == THREAD:
52:       return NULLABLE_THREAD
152:   THREAD,
165:   NULLABLE_THREAD,
534:   return (kind.spec == THREAD.spec or kind.spec == NULLABLE_THREAD.spec)
603:           IsThreadKind(kind) or
github.com/googlearchive/appengine-try-python-bottle:lib/bottle.py:[master, ]
79:     import _thread as thread
2717: class FileCheckerThread(threading.Thread):
94:     import thread
1483: #: Thread-local storage for :class:`LocalRequest` and :class:`LocalResponse`
1496:         'Thread-local property stored in :data:`_lctx.%s`' % name)
1500:     ''' A thread-local subclass of :class:`BaseRequest` with a different
1501:         set of attribues for each thread. There is usually only one global
1510:     ''' A thread-local subclass of :class:`BaseResponse` with a different
1511:         set of attribues for each thread. There is usually only one global
2435:             _stderr("         (Fapws3 breaks python thread support)\n")
2473:         thread_pool = ThreadPool()
2474:         thread_pool.start()
2475:         reactor.addSystemEventTrigger('after', 'shutdown', thread_pool.stop)
2476:         factory = server.Site(wsgi.WSGIResource(reactor, thread_pool, handler))
2718:     ''' Interrupt main-thread as soon as a changed module file is detected,
2722:         threading.Thread.__init__(self)
2741:                 thread.interrupt_main()
2745:                     thread.interrupt_main()
2843:         must match self.encoding. This method must be thread-safe!
3212: #: A thread-safe instance of :class:`LocalRequest`. If accessed from within a
3217: #: A thread-safe instance of :class:`LocalResponse`. It is used to change the
3221: #: A thread-safe namespace. Not used by Bottle.
39:         os, re, subprocess, sys, tempfile, threading, time, urllib, warnings
1485: _lctx = threading.local()
2471:         from twisted.python.threadpool import ThreadPool
2697:             bgcheck = FileCheckerThread(lockfile, interval)
2872:         self.context = threading.local()
3222: local = threading.local()
1504:         request (even on a multithreaded server). '''
3214: #: (even on a multithreaded server).
github.com/google/google-api-go-client:gmail/v1/gmail-api.json:[master, ]
1074:   "Thread": {
527:     "threadsTotal": {
532:     "threadsUnread": {
698:     "threads": {
759:     "threadId": {
937:     "threadsTotal": {
3229:     "threads": {
685:   "ListThreadsResponse": {
857:   "ModifyThreadRequest": {
202:    "description": "Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.",
539:      "description": "The owner type for the label. User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. System labels are internally created and cannot be added, modified, or deleted. System labels may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the INBOX and UNREAD labels from messages and threads, but cannot apply or remove the DRAFTS or SENT labels from messages or threads.",
702:       "$ref": "Thread"
761:      "description": "The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: \n- The requested threadId must be specified on the Message or Draft.Message you supply with your request. \n- The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. \n- The Subject headers must match."
863:      "description": "A list of IDs of labels to add to this thread.",
870:      "description": "A list of IDs of labels to remove from this thread.",
1075:    "id": "Thread",
1081:      "description": "The ID of the last history record that modified this thread.",
1086:      "description": "The unique ID of the thread."
1090:      "description": "The list of messages in the thread.",
1603:          "description": "Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request.",
3235:        "description": "Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.",
3239:          "description": "ID of the Thread to delete.",
3263:        "description": "Gets the specified thread.",
3283:          "description": "The ID of the thread to retrieve.",
3306:         "$ref": "Thread"
3375:        "description": "Modifies the labels applied to the thread. This applies to all messages in the thread.",
3379:          "description": "The ID of the thread to modify.",
3399:         "$ref": "Thread"
3410:        "description": "Moves the specified thread to the trash.",
3414:          "description": "The ID of the thread to Trash.",
3431:         "$ref": "Thread"
3442:        "description": "Removes the specified thread from the trash.",
3446:          "description": "The ID of the thread to remove from Trash.",
3463:         "$ref": "Thread"
458:    "description": "Labels are used to categorize messages and threads within the user's mailbox.",
529:      "description": "The total number of threads with the label.",
534:      "description": "The number of unread threads with the label.",
607:      "description": "List of history records. Any messages contained in the response will typically only have id and threadId fields populated.",
700:      "description": "List of threads.",
939:      "description": "The total number of threads in the mailbox.",
1665:        "description": "Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.",
3232:        "id": "gmail.users.threads.delete",
3233:        "path": "{userId}/threads/{id}",
3260:        "id": "gmail.users.threads.get",
3261:        "path": "{userId}/threads/{id}",
3316:        "id": "gmail.users.threads.list",
3317:        "path": "{userId}/threads",
3319:        "description": "Lists the threads in the user's mailbox.",
3323:          "description": "Include threads from SPAM and TRASH in the results.",
3329:          "description": "Only return threads with labels that match all of the specified label IDs.",
3335:          "description": "Maximum number of threads to return.",
3347:          "description": "Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\". Parameter cannot be used when accessing the api using the gmail.metadata scope.",
3372:        "id": "gmail.users.threads.modify",
3373:        "path": "{userId}/threads/{id}/modify",
3407:        "id": "gmail.users.threads.trash",
3408:        "path": "{userId}/threads/{id}/trash",
3439:        "id": "gmail.users.threads.untrash",
3440:        "path": "{userId}/threads/{id}/untrash",
686:    "id": "ListThreadsResponse",
858:    "id": "ModifyThreadRequest",
3362:         "$ref": "ListThreadsResponse"
3396:         "$ref": "ModifyThreadRequest"
github.com/google/google-api-ruby-client:generated/google/apis/gmail_v1/representations.rb:[master, ]
235:       class Thread
614:       class Thread
163:       class ListThreadsResponse
199:       class ModifyThreadRequest
482:       class ListThreadsResponse
548:       class ModifyThreadRequest
487:           collection :threads, as: 'threads', class: Google::Apis::GmailV1::Thread, decorator: Google::Apis::GmailV1::Thread::Representation
504:           property :thread_id, as: 'threadId'
406:           property :threads_total, as: 'threadsTotal'
407:           property :threads_unread, as: 'threadsUnread'
570:           property :threads_total, as: 'threadsTotal'
github.com/google/google-api-ruby-client:generated/google/apis/gmail_v1/classes.rb:[master, ]
1289:       class Thread
748:       class ListThreadsResponse
1002:       class ModifyThreadRequest
134:       # instead of an entire email thread.
529:         # modified and deleted by the user and can be applied to any message or thread.
763:         # @return [Array<Google::Apis::GmailV1::Thread>]
829:         # The ID of the thread the message belongs to. To add a message or draft to a
830:         # thread, the following criteria must be met:
838:         attr_accessor :thread_id
854:           @thread_id = args[:thread_id] if args.key?(:thread_id)
1005:         # A list of IDs of labels to add to this thread.
1010:         # A list of IDs of labels to remove from this thread.
1292:         # The ID of the last history record that modified this thread.
1297:         # The unique ID of the thread.
1302:         # The list of messages in the thread.
484:       # Labels are used to categorize messages and threads within the user's mailbox.
518:         # The total number of threads with the label.
519:         # Corresponds to the JSON property `threadsTotal`
521:         attr_accessor :threads_total
523:         # The number of unread threads with the label.
524:         # Corresponds to the JSON property `threadsUnread`
526:         attr_accessor :threads_unread
532:         # threads under some circumstances but this is not guaranteed. For example,
534:         # threads, but cannot apply or remove the DRAFTS or SENT labels from messages or
535:         # threads.
552:           @threads_total = args[:threads_total] if args.key?(:threads_total)
553:           @threads_unread = args[:threads_unread] if args.key?(:threads_unread)
632:         # only have id and threadId fields populated.
761:         # List of threads.
762:         # Corresponds to the JSON property `threads`
764:         attr_accessor :threads
774:           @threads = args[:threads] if args.key?(:threads)
831:         # - The requested threadId must be specified on the Message or Draft.Message you
836:         # Corresponds to the JSON property `threadId`
1071:         # The total number of threads in the mailbox.
1072:         # Corresponds to the JSON property `threadsTotal`
1074:         attr_accessor :threads_total
1085:           @threads_total = args[:threads_total] if args.key?(:threads_total)
github.com/webmproject/udpsample:receivedecompressandplay.cpp:[master, ]
87: HANDLE thread;
88: DWORD thread_id;
373: static int event_thread(void *data) {
285: SDL_Thread *mythread;
143:   thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) display_win_main,
144:                         (LPVOID) NULL, 0, &thread_id);
258: #include <SDL/SDL_thread.h>
276: static int event_thread(void *data);
323:   /* initialize thread data */
329:   mythread = SDL_CreateThread(event_thread, (void *) &ptdata);
1208:   /* Message loop for display window's thread */
133:     ExitThread(-1);
368:   SDL_WaitThread(mythread, &status);
github.com/fuchsia-mirror/third_party-mako:mako/compat.py:[master, ]
113:         import _thread as thread
119:         import _dummy_thread as thread
121:         import dummy_thread as thread  # noqa
117:     import dummy_threading as threading  # noqa
115:         import thread
111:     import threading
github.com/firebase/office-mover-5000:ios/OfficeMover5000/GoogleOpenSource.framework/Versions/A/Headers/GTMHTTPFetcher.h:[master, ]
duplicate result
github.com/google/volley:src/main/java/com/android/volley/VolleyLog.java:[master, ]
116:             public final long thread;
81:      * calling thread ID and method name.
102:                 Thread.currentThread().getId(), caller, msg);
106:      * A simple event log with records containing a name, thread ID, and timestamp.
119:             public Marker(String name, long thread, long time) {
121:                 this.thread = thread;
155:                 d("(+%-4d) [%2d] %s", (thisTime - prevTime), marker.thread, marker.name);
130:         public synchronized void add(String name, long threadId) {
135:             mMarkers.add(new Marker(name, threadId, SystemClock.elapsedRealtime()));