Commit e873db59 authored by Pekka Pessi's avatar Pekka Pessi

Added win32 pthread library.

darcs-hash:20050922101532-65a35-f133fbf6efb0776dc260fe08d0fa2799f7973aa7.gz
parent 46d40968
This diff is collapsed.
799d3a4e6142748584790a89e4b3f9b2 ChangeLog
71bc1822a1a860a46f117e0f5147f77e pthread.def
f893a822b955fb50e9e10d7dfaa43b02 pthread.dll
948fa230445c69f464560f5217c333ef pthread.h
571ddcac9c41539d70626ad43e6477f5 pthread.lib
f12a296de03f5a59f8bb1c126b5d3c81 sched.h
76a7a70f391f0d4823e5e67e574f6e36 semaphore.h
; pthread.def
; Last updated: $Date: 2001/02/23 13:23:36 $
; Currently unimplemented functions are commented out.
LIBRARY pthread
EXPORTS
;pthread_atfork
pthread_attr_destroy
pthread_attr_getdetachstate
;pthread_attr_getinheritsched
pthread_attr_getschedparam
;pthread_attr_getschedpolicy
;pthread_attr_getscope
pthread_attr_getstackaddr
pthread_attr_getstacksize
pthread_attr_init
pthread_attr_setdetachstate
;pthread_attr_setinheritsched
pthread_attr_setschedparam
;pthread_attr_setschedpolicy
;pthread_attr_setscope
pthread_attr_setstackaddr
pthread_attr_setstacksize
pthread_cancel
;
; These are implemented as macros
;
;pthread_cleanup_pop
;pthread_cleanup_push
;
pthread_condattr_destroy
pthread_condattr_getpshared
pthread_condattr_init
pthread_condattr_setpshared
pthread_cond_broadcast
pthread_cond_destroy
pthread_cond_init
pthread_cond_signal
pthread_cond_timedwait
pthread_cond_wait
pthread_create
pthread_detach
pthread_equal
pthread_exit
pthread_getschedparam
pthread_getspecific
pthread_join
pthread_key_create
pthread_key_delete
;pthread_kill
pthread_mutexattr_destroy
;pthread_mutexattr_getprioceiling
;pthread_mutexattr_getprotocol
pthread_mutexattr_getpshared
pthread_mutexattr_init
;pthread_mutexattr_setprioceiling
;pthread_mutexattr_setprotocol
pthread_mutexattr_setpshared
pthread_mutexattr_destroy
pthread_mutex_init
pthread_mutex_destroy
pthread_mutex_lock
pthread_mutex_trylock
pthread_mutex_unlock
pthread_once
pthread_self
pthread_setcancelstate
pthread_setcanceltype
pthread_setschedparam
pthread_setspecific
;pthread_sigmask
pthread_testcancel
;
; POSIX 1.b
;
sched_get_priority_min
sched_get_priority_max
sched_yield
sem_init
sem_destroy
sem_trywait
sem_wait
sem_post
sem_open
sem_close
sem_unlink
sem_getvalue
;
; Read/Write Locks
;
pthread_rwlock_init
pthread_rwlock_destroy
pthread_rwlock_tryrdlock
pthread_rwlock_trywrlock
pthread_rwlock_rdlock
pthread_rwlock_wrlock
pthread_rwlock_unlock
;
; Non-portable but useful
;
pthread_mutexattr_setforcecs_np
pthreadCancelableWait
pthreadCancelableTimedWait
;
; Needed if !defined(_MSC_VER) && !defined(__cplusplus)
;
pthread_push_cleanup
pthread_pop_cleanup
This diff is collapsed.
/*
* Module: sched.h
*
* Purpose:
* Provides an implementation of POSIX realtime extensions
* as defined in
*
* POSIX 1003.1b-1993 (POSIX.1b)
*
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright (C) 1998
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA
*/
#ifndef _SCHED_H
#define _SCHED_H
#ifdef _MSC_VER
/*
* Disable following warnings when including Windows headers
*
* warning C4115: named type definition in parentheses
* warning C4116: unnamed type definition in parentheses
* warning C4127: conditional expression is constant
* warning C4201: nonstandard extension used : nameless struct/union
* warning C4214: nonstandard extension used : bit field types other than int
* warning C4514: unreferenced inline function has been removed
*/
#pragma warning( disable : 4115 4116 4127 4201 4214 4514)
#endif
#include <windows.h>
#include <process.h>
#include <errno.h>
#ifdef _MSC_VER
/*
* Re-enable all but 4127, 4514
*/
#pragma warning( default : 4115 4116 4201 4214)
#endif
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
int sched_yield (void);
int sched_get_priority_min (int policy);
int sched_get_priority_max (int policy);
#ifdef __cplusplus
} /* End of extern "C" */
#endif /* __cplusplus */
#endif /* !_SCHED_H */
/*
* Module: semaphore.h
*
* Purpose:
* Semaphores aren't actually part of the PThreads standard.
* They are defined by the POSIX Standard:
*
* POSIX 1003.1b-1993 (POSIX.1b)
*
* Pthreads-win32 - POSIX Threads Library for Win32
* Copyright (C) 1998
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA
*/
#if !defined( SEMAPHORE_H )
#define SEMAPHORE_H
#include <process.h>
#include <errno.h>
#define _POSIX_SEMAPHORES
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#if defined(_MSC_VER)
typedef unsigned int mode_t;
#endif
typedef HANDLE sem_t;
int sem_init (sem_t * sem,
int pshared,
unsigned int value
);
int sem_destroy (sem_t * sem
);
int sem_trywait (sem_t * sem
);
int sem_wait (sem_t * sem
);
int sem_post (sem_t * sem
);
int sem_open (const char * name,
int oflag,
mode_t mode,
unsigned int value
);
int sem_close (sem_t * sem
);
int sem_unlink (const char * name
);
int sem_getvalue (sem_t * sem,
int * sval
);
#ifdef __cplusplus
} /* End of extern "C" */
#endif /* __cplusplus */
#endif /* !SEMAPHORE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment