Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1108)

Side by Side Diff: third_party/libjingle/files/talk/base/thread.h

Issue 274079: Prevent thread creation if Join has already been called.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | third_party/libjingle/files/talk/base/thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2004--2005, Google Inc. 3 * Copyright 2004--2005, Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 #endif 128 #endif
129 129
130 private: 130 private:
131 static void *PreRun(void *pv); 131 static void *PreRun(void *pv);
132 void Join(); 132 void Join();
133 133
134 std::list<_SendMessage> sendlist_; 134 std::list<_SendMessage> sendlist_;
135 ThreadPriority priority_; 135 ThreadPriority priority_;
136 CriticalSection started_crit_; 136 CriticalSection started_crit_;
137 bool started_; 137 bool started_;
138 bool stopped_;
138 bool has_sends_; 139 bool has_sends_;
139 140
140 #ifdef POSIX 141 #ifdef POSIX
141 pthread_t thread_; 142 pthread_t thread_;
142 #endif 143 #endif
143 144
144 #ifdef WIN32 145 #ifdef WIN32
145 HANDLE thread_; 146 HANDLE thread_;
146 #endif 147 #endif
147 148
148 friend class ThreadManager; 149 friend class ThreadManager;
149 }; 150 };
150 151
151 // AutoThread automatically installs itself at construction 152 // AutoThread automatically installs itself at construction
152 // uninstalls at destruction, if a Thread object is 153 // uninstalls at destruction, if a Thread object is
153 // _not already_ associated with the current OS thread. 154 // _not already_ associated with the current OS thread.
154 155
155 class AutoThread : public Thread { 156 class AutoThread : public Thread {
156 public: 157 public:
157 AutoThread(SocketServer* ss = 0); 158 AutoThread(SocketServer* ss = 0);
158 virtual ~AutoThread(); 159 virtual ~AutoThread();
159 }; 160 };
160 161
161 } // namespace talk_base 162 } // namespace talk_base
162 163
163 #endif // TALK_BASE_THREAD_H__ 164 #endif // TALK_BASE_THREAD_H__
OLDNEW
« no previous file with comments | « no previous file | third_party/libjingle/files/talk/base/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698