nginx-0.0.1-2002-08-15-21:20:26 import
diff --git a/src/event/ngx_event_mutex.c b/src/event/ngx_event_mutex.c
new file mode 100644
index 0000000..5a9542b
--- /dev/null
+++ b/src/event/ngx_event_mutex.c
@@ -0,0 +1,14 @@
+
+spinlock_max depend on CPU number and mutex type.
+    1 CPU               1
+    ngx_malloc_mutex    1000 ?
+
+
+int ngx_event_mutex_trylock(ngx_mutex_t *mtx)
+{
+    for(i = mtx->spinlock_max; i; i--)
+        if (trylock(mtx->lock))
+            return 1;
+
+    return 0;
+}