File: IxpThread.3

package info (click to toggle)
libixp 0.6~20121202%2Bhg148-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 988 kB
  • sloc: ansic: 4,908; sh: 142; perl: 121; makefile: 111
file content (89 lines) | stat: -rw-r--r-- 2,483 bytes parent folder | download | duplicates (2)
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
.TH "IXPTHREAD" 3 "2012 Dec" "libixp Manual"


.SH NAME

.P
IxpThread, IxpMutex, IxpRWLock, IxpRendez, ixp_thread

.SH SYNOPSIS

.nf
#include <ixp.h>

typedef struct IxpThread IxpThread;
struct IxpThread {
        /* Read/write lock */
        int     (*initrwlock)(IxpRWLock*);
        void    (*rlock)(IxpRWLock*);
        int     (*canrlock)(IxpRWLock*);
        void    (*runlock)(IxpRWLock*);
        void    (*wlock)(IxpRWLock*);
        int     (*canwlock)(IxpRWLock*);
        void    (*wunlock)(IxpRWLock*);
        void    (*rwdestroy)(IxpRWLock*);
        /* Mutex */
        int     (*initmutex)(IxpMutex*);
        void    (*lock)(IxpMutex*);
        int     (*canlock)(IxpMutex*);
        void    (*unlock)(IxpMutex*);
        void    (*mdestroy)(IxpMutex*);
        /* Rendezvous point */
        int     (*initrendez)(IxpRendez*);
        void    (*sleep)(IxpRendez*);
        int     (*wake)(IxpRendez*);
        int     (*wakeall)(IxpRendez*);
        void    (*rdestroy)(IxpRendez*);
        /* Other */
        char*   (*errbuf)(void);
        ssize_t (*read)(int, void*, size_t);
        ssize_t (*write)(int, const void*, size_t);
        int     (*select)(int, fd_set*, fd_set*, fd_set*, struct timeval*);
}

typedef struct IxpMutex IxpMutex;
struct IxpMutex {
        void*   aux;
}

typedef struct IxpRWLock IxpRWLock;
struct IxpRWLock {
        void*   aux;
}

typedef struct IxpRendez IxpRendez;
struct IxpRendez {
        IxpMutex*       mutex;
        void*   aux;
}

IxpThread*       ixp_thread;
.fi


.SH DESCRIPTION

.P
The IxpThread structure is used to adapt libixp to any of the
myriad threading systems it may be used with. Before any
other of libixp's functions is called, ixp_thread may be set
to a structure filled with implementations of various locking
primitives, along with primitive IO functions which may
perform context switches until data is available.

.P
The names of the functions should be fairly self\-explanitory.
Read/write locks should allow multiple readers and a single
writer of a shared resource, but should not allow new readers
while a writer is waitng for a lock. Mutexes should allow
only one accessor at a time. Rendezvous points are similar to
pthread condition types. \fIerrbuf\fR should return a
thread\-local buffer or the size IXP_ERRMAX.

.SH SEE ALSO

.P
ixp_pthread_init(3), ixp_taskinit(3), ixp_rubyinit(3)

.\" man code generated by txt2tags 2.6 (http://txt2tags.org)
.\" cmdline: txt2tags -o- IxpThread.man3