~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/lib/lib7z/Threads.h

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Threads.h -- multithreading library
 
2
2009-03-27 : Igor Pavlov : Public domain */
 
3
 
 
4
#ifndef __7Z_THREADS_H
 
5
#define __7Z_THREADS_H
 
6
 
 
7
#include "Types.h"
 
8
 
 
9
#ifdef __cplusplus
 
10
extern "C" {
 
11
#endif
 
12
 
 
13
WRes HandlePtr_Close(HANDLE *h);
 
14
WRes Handle_WaitObject(HANDLE h);
 
15
 
 
16
typedef HANDLE CThread;
 
17
#define Thread_Construct(p) *(p) = NULL
 
18
#define Thread_WasCreated(p) (*(p) != NULL)
 
19
#define Thread_Close(p) HandlePtr_Close(p)
 
20
#define Thread_Wait(p) Handle_WaitObject(*(p))
 
21
typedef unsigned THREAD_FUNC_RET_TYPE;
 
22
#define THREAD_FUNC_CALL_TYPE MY_STD_CALL
 
23
#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE
 
24
typedef THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE * THREAD_FUNC_TYPE)(void *);
 
25
WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param);
 
26
 
 
27
typedef HANDLE CEvent;
 
28
typedef CEvent CAutoResetEvent;
 
29
typedef CEvent CManualResetEvent;
 
30
#define Event_Construct(p) *(p) = NULL
 
31
#define Event_IsCreated(p) (*(p) != NULL)
 
32
#define Event_Close(p) HandlePtr_Close(p)
 
33
#define Event_Wait(p) Handle_WaitObject(*(p))
 
34
WRes Event_Set(CEvent *p);
 
35
WRes Event_Reset(CEvent *p);
 
36
WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled);
 
37
WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p);
 
38
WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled);
 
39
WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p);
 
40
 
 
41
typedef HANDLE CSemaphore;
 
42
#define Semaphore_Construct(p) (*p) = NULL
 
43
#define Semaphore_Close(p) HandlePtr_Close(p)
 
44
#define Semaphore_Wait(p) Handle_WaitObject(*(p))
 
45
WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount);
 
46
WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num);
 
47
WRes Semaphore_Release1(CSemaphore *p);
 
48
 
 
49
typedef CRITICAL_SECTION CCriticalSection;
 
50
WRes CriticalSection_Init(CCriticalSection *p);
 
51
#define CriticalSection_Delete(p) DeleteCriticalSection(p)
 
52
#define CriticalSection_Enter(p) EnterCriticalSection(p)
 
53
#define CriticalSection_Leave(p) LeaveCriticalSection(p)
 
54
 
 
55
#ifdef __cplusplus
 
56
}
 
57
#endif
 
58
 
 
59
#endif