File: mutex-pthread.c

package info (click to toggle)
haskell-hsopenssl 0.11.7.9-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 544 kB
  • sloc: haskell: 1,469; ansic: 451; makefile: 14
file content (26 lines) | stat: -rw-r--r-- 365 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "mutex.h"

void mutex_init(mutex_t* mutex)
{
  pthread_mutex_init(mutex, NULL);
}

void mutex_destroy(mutex_t* mutex)
{
  pthread_mutex_destroy(mutex);
}

void mutex_lock(mutex_t* mutex)
{
  pthread_mutex_lock(mutex);
}

void mutex_unlock(mutex_t* mutex)
{
  pthread_mutex_unlock(mutex);
}

unsigned long self()
{
  return (unsigned long)pthread_self();
}