Changeset 53081 in vbox
- Timestamp:
- Oct 16, 2014 6:43:26 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/linux/sched-linux.cpp
r48935 r53081 312 312 { 313 313 /* 314 * Setup thread attributes.315 */ 316 pthread_ attr_t ThreadAttr;317 int rc = pthread_ attr_init(&ThreadAttr);314 * Create the thread. 315 */ 316 pthread_t Thread; 317 int rc = pthread_create(&Thread, NULL, pfnThread, pvArg); 318 318 if (!rc) 319 319 { 320 rc = pthread_attr_setdetachstate(&ThreadAttr, PTHREAD_CREATE_JOINABLE); 321 if (!rc) 320 /* 321 * Wait for the thread to finish. 322 */ 323 void *pvRet = (void *)-1; 324 do 322 325 { 323 rc = pthread_attr_setstacksize(&ThreadAttr, 128*1024); 324 if (!rc) 325 { 326 /* 327 * Create the thread. 328 */ 329 pthread_t Thread; 330 rc = pthread_create(&Thread, &ThreadAttr, pfnThread, pvArg); 331 if (!rc) 332 { 333 /* 334 * Wait for the thread to finish. 335 */ 336 void *pvRet = (void *)-1; 337 do 338 { 339 rc = pthread_join(Thread, &pvRet); 340 } while (errno == EINTR); 341 if (rc) 342 return RTErrConvertFromErrno(rc); 343 return (int)(uintptr_t)pvRet; 344 } 345 } 346 } 347 pthread_attr_destroy(&ThreadAttr); 326 rc = pthread_join(Thread, &pvRet); 327 } while (errno == EINTR); 328 if (rc) 329 return RTErrConvertFromErrno(rc); 330 return (int)(uintptr_t)pvRet; 348 331 } 349 332 return RTErrConvertFromErrno(rc);
Note:
See TracChangeset
for help on using the changeset viewer.