Changeset 33 for trunk/src/helpers/threads.c
- Timestamp:
- Feb 7, 2001, 7:30:59 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/threads.c
r22 r33 182 182 * to the caller. 183 183 * 184 * This now (V0.9.9) returns the TID of the new thread or 185 * null on errors. 186 * 184 187 *@@changed V0.9.0 [umoeller]: default stack size raised for Watcom (thanks, Rdiger Ihle) 185 188 *@@changed V0.9.0 [umoeller]: _beginthread is now only called after all variables have been set (thanks, Rdiger Ihle) … … 190 193 *@@changed V0.9.5 (2000-08-26) [umoeller]: now using PTHREADINFO 191 194 *@@changed V0.9.7 (2000-12-18) [lafaix]: THRF_TRANSIENT support added 192 */ 193 194 BOOL thrCreate(PTHREADINFO pti, // out: THREADINFO data 195 PTHREADFUNC pfn, // in: _Optlink thread function 196 PBOOL pfRunning, // out: variable set to TRUE while thread is running; 197 // ptr can be NULL 198 ULONG flFlags, // in: THRF_* flags 199 ULONG ulData) // in: user data to be stored in THREADINFO 200 { 201 BOOL rc = FALSE; 195 *@@changed V0.9.9 (2000-02-06) [umoeller]: now returning TID 196 */ 197 198 ULONG thrCreate(PTHREADINFO pti, // out: THREADINFO data 199 PTHREADFUNC pfn, // in: _Optlink thread function 200 PBOOL pfRunning, // out: variable set to TRUE while thread is running; 201 // ptr can be NULL 202 ULONG flFlags, // in: THRF_* flags 203 ULONG ulData) // in: user data to be stored in THREADINFO 204 { 205 ULONG ulrc = 0; // V0.9.9 (2000-02-06) [umoeller] 202 206 203 207 // (2000-12-18) [lafaix] TRANSIENT … … 206 210 if (pti == NULL) 207 211 pti = (PTHREADINFO) malloc(sizeof(THREADINFO)); 208 else209 return (rc);210 212 } 211 213 … … 223 225 pti->ulData = ulData; 224 226 225 rc = TRUE;226 227 227 if (flFlags & THRF_WAIT) 228 228 // "Wait" flag set: create an event semaphore which … … 233 233 FALSE) // not posted (reset) 234 234 != NO_ERROR) 235 rc = FALSE; 236 237 pti->fExit = FALSE; 238 239 if (rc) 235 { 236 if (flFlags & THRF_TRANSIENT) 237 free(pti); 238 239 // stop right here 240 pti = NULL; 241 } 242 243 if (pti) 240 244 { 241 245 pti->tid = _beginthread( // moved, V0.9.0 (hint: Rdiger Ihle) … … 244 248 3*96000, // plenty of stack 245 249 pti); // parameter passed to thread 246 rc = (pti->tid != 0);247 248 if ( rc)250 ulrc = pti->tid; 251 252 if (ulrc) 249 253 if (flFlags & THRF_WAIT) 250 254 { … … 257 261 } 258 262 259 return ( rc);263 return (ulrc); 260 264 } 261 265
Note:
See TracChangeset
for help on using the changeset viewer.