Showing the changes to codec/common/src/WelsThreadLib.cpp (1 of 19 files). Show all
Unified · Split
| @@ -302,7 +302,7 @@ WELS_THREAD_ERROR_CODE WelsEventOpen (WELS_EVENT* p_event, const char* event_ · 301 unmodified lines | ||
| 302 | 302 | if (p_event == NULL) { |
| 303 | 303 | return WELS_THREAD_ERROR_GENERAL; |
| 304 | 304 | } |
| 305 | − char strSuffix[16] = { 0 }; | |
| 305 | + char strSuffix[100] = { 0 }; | |
| 306 | 306 | if (NULL == event_name) { |
| 307 | 307 | sprintf (strSuffix, "WelsSem%ld_p%ld", (intptr_t)p_event, (long) (getpid())); |
| 308 | 308 | event_name = &strSuffix[0]; |
| @@ -341,6 +341,10 @@ WELS_THREAD_ERROR_CODE WelsEventClose (WELS_EVENT* event, const char* event_n · 32 unmodified lines | ||
| 341 | 341 | #endif |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | +void WelsSleep (uint32_t dwMilliSecond) { | |
| 345 | + usleep (dwMilliSecond * 1000); | |
| 346 | +} | |
| 347 | + | |
| 344 | 348 | WELS_THREAD_ERROR_CODE WelsEventSignal (WELS_EVENT* event) { |
| 345 | 349 | WELS_THREAD_ERROR_CODE err = 0; |
| 346 | 350 | // int32_t val = 0; |
| @@ -356,10 +360,6 @@ WELS_THREAD_ERROR_CODE WelsEventWait (WELS_EVENT* event) { · 9 unmodified lines | ||
| 356 | 360 | return sem_wait (*event); // blocking until signaled |
| 357 | 361 | } |
| 358 | 362 | |
| 359 | −void WelsSleep (uint32_t dwMilliSecond) { | |
| 360 | − usleep (dwMilliSecond * 1000); | |
| 361 | −} | |
| 362 | − | |
| 363 | 363 | WELS_THREAD_ERROR_CODE WelsEventWaitWithTimeOut (WELS_EVENT* event, uint32_t dwMilliseconds) { |
| 364 | 364 | if (dwMilliseconds != (uint32_t) - 1) { |
| 365 | 365 | return sem_wait (*event); |