~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/w32pthreads.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

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
 
typedef struct {
 
42
#include "libavutil/internal.h"
 
43
#include "libavutil/mem.h"
 
44
 
 
45
typedef struct pthread_t {
43
46
    void *handle;
44
47
    void *(*func)(void* arg);
45
48
    void *arg;
53
56
/* This is the CONDITIONAL_VARIABLE typedef for using Window's native
54
57
 * conditional variables on kernels 6.0+.
55
58
 * MinGW does not currently have this typedef. */
56
 
typedef struct {
 
59
typedef struct pthread_cond_t {
57
60
    void *ptr;
58
61
} pthread_cond_t;
59
62
 
114
117
 
115
118
/* for pre-Windows 6.0 platforms we need to define and use our own condition
116
119
 * variable and api */
117
 
typedef struct {
 
120
typedef struct  win32_cond_t {
118
121
    pthread_mutex_t mtx_broadcast;
119
122
    pthread_mutex_t mtx_waiter_count;
120
123
    volatile int waiter_count;
194
197
    pthread_mutex_unlock(&win32_cond->mtx_broadcast);
195
198
}
196
199
 
197
 
static void pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
 
200
static int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
198
201
{
199
202
    win32_cond_t *win32_cond = cond->ptr;
200
203
    int last_waiter;
201
204
    if (cond_wait) {
202
205
        cond_wait(cond, mutex, INFINITE);
203
 
        return;
 
206
        return 0;
204
207
    }
205
208
 
206
209
    /* non native condition variables */