~ubuntu-branches/ubuntu/vivid/php-apcu/vivid

« back to all changes in this revision

Viewing changes to apcu-4.0.4/apc_windows_srwlock_kernel.h

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2014-06-24 10:52:52 UTC
  • mfrom: (7.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140624105252-vsqs1r4og4ykucqg
Tags: 4.0.6-1
* New upstream version 4.0.6
* Remove PHP 5.6 support patch - merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
  +----------------------------------------------------------------------+
3
 
  | APC                                                                  |
4
 
  +----------------------------------------------------------------------+
5
 
  | Copyright (c) 2006-2011 The PHP Group                                |
6
 
  +----------------------------------------------------------------------+
7
 
  | This source file is subject to version 3.01 of the PHP license,      |
8
 
  | that is bundled with this package in the file LICENSE, and is        |
9
 
  | available through the world-wide-web at the following url:           |
10
 
  | http://www.php.net/license/3_01.txt                                  |
11
 
  | If you did not receive a copy of the PHP license and are unable to   |
12
 
  | obtain it through the world-wide-web, please send a note to          |
13
 
  | license@php.net so we can mail you a copy immediately.               |
14
 
  +----------------------------------------------------------------------+
15
 
  | Authors: Pierre Joye <pierre@php.net>                                |
16
 
  +----------------------------------------------------------------------+
17
 
 */
18
 
/* $Id$ */
19
 
 
20
 
#ifndef APC_WINDOWS_CS_RWLOCK_H
21
 
#define APC_WINDOWS_CS_RWLOCK_H
22
 
 
23
 
#include "apc.h"
24
 
 
25
 
#ifdef APC_SRWLOCK_KERNEL
26
 
 
27
 
typedef struct _RTL_RWLOCK {
28
 
   RTL_CRITICAL_SECTION rtlCS;
29
 
 
30
 
   HANDLE hSharedReleaseSemaphore;
31
 
   UINT   uSharedWaiters;
32
 
 
33
 
   HANDLE hExclusiveReleaseSemaphore;
34
 
   UINT   uExclusiveWaiters;
35
 
 
36
 
   INT    iNumberActive;
37
 
   HANDLE hOwningThreadId;
38
 
   DWORD  dwTimeoutBoost;
39
 
   PVOID  pDebugInfo;
40
 
} RTL_RWLOCK, *LPRTL_RWLOCK;
41
 
 
42
 
#define apc_windows_cs_rwlock_t RTL_RWLOCK
43
 
 
44
 
struct apc_windows_cs_rwlock_t {
45
 
    CRITICAL_SECTION cs;
46
 
    LONG writers_waiting_count;
47
 
    LONG readers_waiting_count;
48
 
    DWORD active_writers_readers_flag;
49
 
    HANDLE ready_to_read;
50
 
    HANDLE ready_to_write;
51
 
    DWORD reader_races_lost;
52
 
};
53
 
 
54
 
apc_windows_cs_rwlock_t *apc_windows_cs_create(apc_windows_cs_rwlock_t *lock TSRMLS_DC);
55
 
void apc_windows_cs_destroy(apc_windows_cs_rwlock_t *lock);
56
 
void apc_windows_cs_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC);
57
 
void apc_windows_cs_rdlock(apc_windows_cs_rwlock_t *lock TSRMLS_DC);
58
 
void apc_windows_cs_unlock_rd(apc_windows_cs_rwlock_t *lock TSRMLS_DC);
59
 
void apc_windows_cs_unlock_wr(apc_windows_cs_rwlock_t *lock TSRMLS_DC);
60
 
# if NONBLOCKING_LOCK_AVAILABLE==1 /* Only in win7/2008 */
61
 
zend_bool apc_pthreadrwlock_nonblocking_lock(apc_windows_cs_rwlock_t *lock TSRMLS_DC);
62
 
# endif
63
 
#endif
64
 
 
65
 
#endif
66
 
 
67
 
/*
68
 
 * Local variables:
69
 
 * tab-width: 4
70
 
 * c-basic-offset: 4
71
 
 * End:
72
 
 * vim>600: expandtab sw=4 ts=4 sts=4 fdm=marker
73
 
 * vim<600: expandtab sw=4 ts=4 sts=4
74
 
 */