Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pthread.cc « cygwin « winsup - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f535318fe48d354f07cf0031ab68ebd40d87a6e0 (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
/* pthread.cc: posix pthread interface for Cygwin

   Copyright 1998 Cygnus Solutions.

   Written by Marco Fuykschot <marco@ddi.nl>

   This file is part of Cygwin.

   This software is a copyrighted work licensed under the terms of the
   Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
   details. */

#include "winsup.h"

extern "C" {
/*  ThreadCreation */
int
pthread_create (pthread_t * thread, const pthread_attr_t * attr, void *(*start_routine) (void *), void *arg)
{
  return __pthread_create (thread, attr, start_routine, arg);
}

int
pthread_attr_init (pthread_attr_t * attr)
{
  return __pthread_attr_init (attr);
}

int
pthread_attr_destroy (pthread_attr_t * attr)
{
  return __pthread_attr_destroy (attr);
}

int
pthread_attr_setstacksize (pthread_attr_t * attr, size_t size)
{
  return __pthread_attr_setstacksize (attr, size);
}

int
pthread_attr_getstacksize (pthread_attr_t * attr, size_t * size)
{
  return __pthread_attr_getstacksize (attr, size);
}


/*
   pthread_attr_setstackaddr(...){};
   pthread_attr_getstackaddr(...){};
 */

/* Thread Exit */
int
pthread_exit (void * value_ptr)
{
  return __pthread_exit (value_ptr);
}

int
pthread_join(pthread_t thread, void **return_val)
{
  return __pthread_join(&thread, (void **)return_val);
}

int
pthread_detach(pthread_t thread)
{
  return __pthread_detach(&thread);
}

int
pthread_suspend(pthread_t thread)
{
   return __pthread_suspend(&thread);
}

int
pthread_continue(pthread_t thread)
{
   return __pthread_continue(&thread);
}

unsigned long
pthread_getsequence_np (pthread_t * thread)
{
  return __pthread_getsequence_np (thread);
}

/* Thread SpecificData */
int
pthread_key_create (pthread_key_t * key)
{
  return __pthread_key_create (key);
}

int
pthread_key_delete (pthread_key_t * key)
{
  return __pthread_key_delete (key);
}

int
pthread_setspecific (pthread_key_t * key, const void *value)
{
  return __pthread_setspecific (key, value);
}

void *
pthread_getspecific (pthread_key_t * key)
{
  return (void *) __pthread_getspecific (key);
}

/* Thread signal */
int
pthread_kill (pthread_t * thread, int sig)
{
  return __pthread_kill (thread, sig);
}

int
pthread_sigmask (int operation, const sigset_t * set, sigset_t * old_set)
{
  return __pthread_sigmask (operation, set, old_set);
}

/*  ID */

pthread_t
pthread_self ()
{
  return __pthread_self ();
}

int
pthread_equal (pthread_t t1, pthread_t t2)
{
  return __pthread_equal ( &t1, &t2);
}

/* Mutexes  */
int
pthread_mutex_init (pthread_mutex_t * mutex, const pthread_mutexattr_t * attr)
{
  return __pthread_mutex_init (mutex, attr);
}

int
pthread_mutex_lock (pthread_mutex_t * mutex)
{
  return __pthread_mutex_lock (mutex);
}

int
pthread_mutex_trylock (pthread_mutex_t * mutex)
{
  return __pthread_mutex_trylock (mutex);
}

int
pthread_mutex_unlock (pthread_mutex_t * mutex)
{
  return __pthread_mutex_unlock (mutex);
}

int
pthread_mutex_destroy (pthread_mutex_t * mutex)
{
  return __pthread_mutex_destroy (mutex);
}

/* Semaphores */
int
sem_init (sem_t * sem, int pshared, unsigned int value)
{
  return __sem_init (sem, pshared, value);
}

int
sem_destroy (sem_t * sem)
{
  return __sem_destroy (sem);
}

int
sem_wait (sem_t * sem)
{
  return __sem_wait (sem);
}

int
sem_trywait (sem_t * sem)
{
  return __sem_trywait (sem);
}

int
sem_post (sem_t * sem)
{
  return __sem_post (sem);
}
}