History

astyle all files

huili2 committed 12 years ago

Commit 5ed24f21 parent 0c24686120 files · +3967 −3886Browse files

Showing the changes to codec/common/src/WelsThreadLib.cpp (1 of 120 files). Show all

Unified · Split

codec/common/src/WelsThreadLib.cpp+10−10
@@ -175,13 +175,13 @@ WELS_THREAD_ERROR_CODE WelsEventClose (WELS_EVENT* event, const char* event_n · 174 unmodified lines
175WELS_THREAD_ERROR_CODE WelsThreadCreate (WELS_THREAD_HANDLE* thread, LPWELS_THREAD_ROUTINE routine,175WELS_THREAD_ERROR_CODE WelsThreadCreate (WELS_THREAD_HANDLE* thread, LPWELS_THREAD_ROUTINE routine,
176 void* arg, WELS_THREAD_ATTR attr) {176 void* arg, WELS_THREAD_ATTR attr) {
177#ifdef USE_THREADPOOL177#ifdef USE_THREADPOOL
178 HANDLE h = CreateEvent(NULL, FALSE, FALSE, NULL);178 HANDLE h = CreateEvent (NULL, FALSE, FALSE, NULL);
179 HANDLE h2;179 HANDLE h2;
180 DuplicateHandle(GetCurrentProcess(), h, GetCurrentProcess(), &h2, 0, FALSE, DUPLICATE_SAME_ACCESS);180 DuplicateHandle (GetCurrentProcess(), h, GetCurrentProcess(), &h2, 0, FALSE, DUPLICATE_SAME_ACCESS);
181 ThreadPool::RunAsync(ref new WorkItemHandler([=](IAsyncAction^) {181 ThreadPool::RunAsync (ref new WorkItemHandler ([ = ] (IAsyncAction^) {
182 routine(arg);182 routine (arg);
183 SetEvent(h2);183 SetEvent (h2);
184 CloseHandle(h2);184 CloseHandle (h2);
185 }, CallbackContext::Any), WorkItemPriority::Normal, WorkItemOptions::TimeSliced);185 }, CallbackContext::Any), WorkItemPriority::Normal, WorkItemOptions::TimeSliced);
186#else186#else
187 WELS_THREAD_HANDLE h = CreateThread (NULL, 0, routine, arg, 0, NULL);187 WELS_THREAD_HANDLE h = CreateThread (NULL, 0, routine, arg, 0, NULL);
@@ -265,15 +265,15 @@ WELS_THREAD_ERROR_CODE WelsEventOpen (WELS_EVENT* p_event, const char* event_ · 77 unmodified lines
265 return WELS_THREAD_ERROR_OK;265 return WELS_THREAD_ERROR_OK;
266 }266 }
267#else267#else
268 WELS_EVENT event = (WELS_EVENT) malloc(sizeof(*event));268 WELS_EVENT event = (WELS_EVENT) malloc (sizeof (*event));
269 if (event == NULL)269 if (event == NULL)
270 return WELS_THREAD_ERROR_GENERAL;270 return WELS_THREAD_ERROR_GENERAL;
271 WELS_THREAD_ERROR_CODE err = sem_init(event, 0, 0);271 WELS_THREAD_ERROR_CODE err = sem_init (event, 0, 0);
272 if (!err) {272 if (!err) {
273 *p_event = event;273 *p_event = event;
274 return err;274 return err;
275 }275 }
276 free(event);276 free (event);
277 return err;277 return err;
278#endif278#endif
279}279}
@@ -285,7 +285,7 @@ WELS_THREAD_ERROR_CODE WelsEventClose (WELS_EVENT* event, const char* event_n · 5 unmodified lines
285 return err;285 return err;
286#else286#else
287 WELS_THREAD_ERROR_CODE err = sem_destroy (*event); // match with sem_init287 WELS_THREAD_ERROR_CODE err = sem_destroy (*event); // match with sem_init
288 free(*event);288 free (*event);
289 return err;289 return err;
290#endif290#endif
291}291}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t