Showing the changes to codec/common/src/WelsThreadLib.cpp (1 of 57 files). Show all
Unified · Split
| @@ -299,12 +299,12 @@ WELS_THREAD_ERROR_CODE WelsEventOpen (WELS_EVENT* p_event, const char* event_ · 298 unmodified lines | ||
| 299 | 299 | } |
| 300 | 300 | WELS_THREAD_ERROR_CODE WelsEventClose (WELS_EVENT* event, const char* event_name) { |
| 301 | 301 | #ifdef __APPLE__ |
| 302 | − WELS_THREAD_ERROR_CODE err = sem_close (*event); // match with sem_open | |
| 302 | + WELS_THREAD_ERROR_CODE err = sem_close (*event); // match with sem_open | |
| 303 | 303 | if (event_name) |
| 304 | 304 | sem_unlink (event_name); |
| 305 | 305 | return err; |
| 306 | 306 | #else |
| 307 | − WELS_THREAD_ERROR_CODE err = sem_destroy (*event); // match with sem_init | |
| 307 | + WELS_THREAD_ERROR_CODE err = sem_destroy (*event); // match with sem_init | |
| 308 | 308 | free (*event); |
| 309 | 309 | return err; |
| 310 | 310 | #endif |
| @@ -322,7 +322,7 @@ WELS_THREAD_ERROR_CODE WelsEventSignal (WELS_EVENT* event) { · 11 unmodified lines | ||
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | WELS_THREAD_ERROR_CODE WelsEventWait (WELS_EVENT* event) { |
| 325 | − return sem_wait (*event); // blocking until signaled | |
| 325 | + return sem_wait (*event); // blocking until signaled | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | WELS_THREAD_ERROR_CODE WelsEventWaitWithTimeOut (WELS_EVENT* event, uint32_t dwMilliseconds) { |
| @@ -360,7 +360,7 @@ WELS_THREAD_ERROR_CODE WelsEventWaitWithTimeOut (WELS_EVENT* event, uint32_t · 31 unmodified lines | ||
| 360 | 360 | WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitSingleBlocking (uint32_t nCount, |
| 361 | 361 | WELS_EVENT* event_list, WELS_EVENT* master_event) { |
| 362 | 362 | uint32_t nIdx = 0; |
| 363 | − uint32_t uiAccessTime = 2; // 2 us once | |
| 363 | + uint32_t uiAccessTime = 2; // 2 us once | |
| 364 | 364 | |
| 365 | 365 | if (nCount == 0) |
| 366 | 366 | return WELS_THREAD_ERROR_WAIT_FAILED; |
| @@ -378,7 +378,7 @@ WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitSingleBlocking (uint32_t nCount, · 11 unmodified lines | ||
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | while (1) { |
| 381 | − nIdx = 0; // access each event by order | |
| 381 | + nIdx = 0; // access each event by order | |
| 382 | 382 | while (nIdx < nCount) { |
| 383 | 383 | int32_t err = 0; |
| 384 | 384 | int32_t wait_count = 0; |
| @@ -399,7 +399,7 @@ WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitSingleBlocking (uint32_t nCount, · 14 unmodified lines | ||
| 399 | 399 | // we do need access next event next time |
| 400 | 400 | ++ nIdx; |
| 401 | 401 | } |
| 402 | − usleep (1); // switch to working threads | |
| 402 | + usleep (1); // switch to working threads | |
| 403 | 403 | if (master_event != NULL) { |
| 404 | 404 | // A master event was used and was signalled, but none of the events in the |
| 405 | 405 | // list was found to be signalled, thus wait a little more when rechecking |
| @@ -423,7 +423,7 @@ WELS_THREAD_ERROR_CODE WelsMultipleEventsWaitAllBlocking (uint32_t nCount, · 17 unmodified lines | ||
| 423 | 423 | return WELS_THREAD_ERROR_WAIT_FAILED; |
| 424 | 424 | |
| 425 | 425 | while (1) { |
| 426 | − nIdx = 0; // access each event by order | |
| 426 | + nIdx = 0; // access each event by order | |
| 427 | 427 | while (nIdx < nCount) { |
| 428 | 428 | const uint32_t kuiBitwiseFlag = (1 << nIdx); |
| 429 | 429 | |