2 |
|
* posix_sem.cpp - POSIX.4 semaphores "emulation" |
3 |
|
* Copyright (C) 1999 Orlando Bassotto |
4 |
|
* |
5 |
< |
* Basilisk II (C) 1997-1999 Christian Bauer |
5 |
> |
* Basilisk II (C) 1997-2005 Christian Bauer |
6 |
|
* |
7 |
|
* This program is free software; you can redistribute it and/or modify |
8 |
|
* it under the terms of the GNU General Public License as published by |
25 |
|
* with mutex. Seems to be working correctly now. |
26 |
|
*/ |
27 |
|
|
28 |
– |
#include <stdio.h> |
28 |
|
#include <sys/types.h> |
29 |
+ |
#include <stdio.h> |
30 |
|
#include <errno.h> |
31 |
+ |
#include <time.h> |
32 |
|
#include <pthread.h> |
33 |
+ |
|
34 |
|
#include "semaphore.h" |
35 |
|
|
36 |
|
extern "C" { |
64 |
|
} |
65 |
|
pthread_mutex_destroy(&sem->sem_lock); |
66 |
|
sem->sem_waiting = 0; |
65 |
– |
sem->sem_lock = NULL; |
67 |
|
sem->sem_value = 0; |
68 |
|
return 0; |
69 |
|
} |