~ubuntu-branches/debian/experimental/libav/experimental

« back to all changes in this revision

Viewing changes to compat/w32pthreads.h

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-08-17 22:33:40 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20140817223340-net3rzywma60pzhz
Tags: 6:11~beta1-1
* New upstream Release v11~alpha2
* build against libgnutls28-dev (Closes: #758447)
* Bump shlibs

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include <windows.h>
40
40
#include <process.h>
41
41
 
 
42
#include "libavutil/attributes.h"
42
43
#include "libavutil/internal.h"
43
44
#include "libavutil/mem.h"
44
45
 
86
87
#define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE)
87
88
#endif
88
89
 
89
 
static unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
 
90
static av_unused unsigned __stdcall attribute_align_arg win32thread_worker(void *arg)
90
91
{
91
92
    pthread_t *h = arg;
92
93
    h->ret = h->func(h->arg);
93
94
    return 0;
94
95
}
95
96
 
96
 
static int pthread_create(pthread_t *thread, const void *unused_attr,
97
 
                          void *(*start_routine)(void*), void *arg)
 
97
static av_unused int pthread_create(pthread_t *thread, const void *unused_attr,
 
98
                                    void *(*start_routine)(void*), void *arg)
98
99
{
99
100
    thread->func   = start_routine;
100
101
    thread->arg    = arg;
103
104
    return !thread->handle;
104
105
}
105
106
 
106
 
static void pthread_join(pthread_t thread, void **value_ptr)
 
107
static av_unused void pthread_join(pthread_t thread, void **value_ptr)
107
108
{
108
109
    DWORD ret = WaitForSingleObject(thread.handle, INFINITE);
109
110
    if (ret != WAIT_OBJECT_0)
145
146
    volatile int is_broadcast;
146
147
} win32_cond_t;
147
148
 
148
 
static void pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
 
149
static av_unused void pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
149
150
{
150
151
    win32_cond_t *win32_cond = NULL;
151
152
    if (cond_init) {
169
170
    pthread_mutex_init(&win32_cond->mtx_broadcast, NULL);
170
171
}
171
172
 
172
 
static void pthread_cond_destroy(pthread_cond_t *cond)
 
173
static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
173
174
{
174
175
    win32_cond_t *win32_cond = cond->ptr;
175
176
    /* native condition variables do not destroy */
185
186
    cond->ptr = NULL;
186
187
}
187
188
 
188
 
static void pthread_cond_broadcast(pthread_cond_t *cond)
 
189
static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
189
190
{
190
191
    win32_cond_t *win32_cond = cond->ptr;
191
192
    int have_waiter;
216
217
    pthread_mutex_unlock(&win32_cond->mtx_broadcast);
217
218
}
218
219
 
219
 
static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
 
220
static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
220
221
{
221
222
    win32_cond_t *win32_cond = cond->ptr;
222
223
    int last_waiter;
248
249
    return pthread_mutex_lock(mutex);
249
250
}
250
251
 
251
 
static void pthread_cond_signal(pthread_cond_t *cond)
 
252
static av_unused void pthread_cond_signal(pthread_cond_t *cond)
252
253
{
253
254
    win32_cond_t *win32_cond = cond->ptr;
254
255
    int have_waiter;
273
274
    pthread_mutex_unlock(&win32_cond->mtx_broadcast);
274
275
}
275
276
 
276
 
static void w32thread_init(void)
 
277
static av_unused void w32thread_init(void)
277
278
{
278
279
#if _WIN32_WINNT < 0x0600
279
280
    HANDLE kernel_dll = GetModuleHandle(TEXT("kernel32.dll"));