Index: trunk/mod_cacher/xc_cacher.c
===================================================================
--- trunk/mod_cacher/xc_cacher.c	(revision 1201)
+++ trunk/mod_cacher/xc_cacher.c	(revision 1204)
@@ -41,5 +41,5 @@
 
 #define ENTER_LOCK_EX(x) \
-	xc_lock((x)->lck); \
+	LOCK((x)); \
 	zend_try { \
 		do
@@ -49,5 +49,5 @@
 		catched = 1; \
 	} zend_end_try(); \
-	xc_unlock((x)->lck)
+	UNLOCK((x))
 
 #define ENTER_LOCK(x) do { \
@@ -2651,10 +2651,11 @@
 		}
 		CHECK(allocator->vtable->init(shm, allocator, memsize), "Failed init allocator");
-		CHECK(cache->cached           = allocator->vtable->calloc(allocator, 1, sizeof(xc_cached_t)), "cache OOM");
-		CHECK(cache->cached->entries  = allocator->vtable->calloc(allocator, hentry->size, sizeof(xc_entry_t*)), "entries OOM");
+		CHECK(cache->cached           = allocator->vtable->calloc(allocator, 1, sizeof(xc_cached_t)), "create cache OOM");
+		CHECK(cache->cached->entries  = allocator->vtable->calloc(allocator, hentry->size, sizeof(xc_entry_t*)), "create entries OOM");
 		if (hphp) {
-			CHECK(cache->cached->phps = allocator->vtable->calloc(allocator, hphp->size, sizeof(xc_entry_data_php_t*)), "phps OOM");
-		}
-		CHECK(cache->lck              = xc_lock_init(NULL, 0), "can't create lock");
+			CHECK(cache->cached->phps = allocator->vtable->calloc(allocator, hphp->size, sizeof(xc_entry_data_php_t*)), "create phps OOM");
+		}
+		CHECK(cache->lck              = allocator->vtable->calloc(allocator, 1, xc_lock_size()), "create lock OOM");
+		CHECK(xc_lock_init(cache->lck, NULL, 1), "can't create lock");
 
 		cache->hcache  = hcache;
