| 94 | } |
| 95 | |
| 96 | static int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size){ |
| 97 | ThreadContext *c= s->thread_opaque; |
| 98 | int i; |
| 99 | int jobnr = 0; |
| 100 | |
| 101 | assert(s == c->avctx); |
| 102 | |
| 103 | /* note, we can be certain that this is not called with the same AVCodecContext by different threads at the same time */ |
| 104 | |
| 105 | for(i=0; i<s->thread_count; i++){ |
| 106 | c[i].arg= arg; |
| 107 | c[i].argsize= size; |
| 108 | c[i].func= func; |
| 109 | c[i].ret= ret; |
| 110 | c[i].jobnr = &jobnr; |
| 111 | } |
| 112 | ReleaseSemaphore(c[0].work_sem, count, 0); |
| 113 | for(i=0; i<count; i++) |
| 114 | WaitForSingleObject(c[0].done_sem, INFINITE); |
| 115 | |
| 116 | return 0; |
| 117 | } |
| 118 | |
| 119 | static int avcodec_thread_execute2(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count){ |
| 120 | ThreadContext *c= s->thread_opaque; |
no outgoing calls
no test coverage detected