diff src/os/unix/ngx_user.c @ 6029:e284f3ff6831

Removed old pthread implementation.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 20 Mar 2015 06:43:19 +0300
parents 457ec43dd8d5
children 4a670c18e5e6
line wrap: on
line diff
--- a/src/os/unix/ngx_user.c
+++ b/src/os/unix/ngx_user.c
@@ -64,16 +64,6 @@ ngx_libc_crypt(ngx_pool_t *pool, u_char 
     size_t      len;
     ngx_err_t   err;
 
-#if (NGX_OLD_THREADS && NGX_NONREENTRANT_CRYPT)
-
-    /* crypt() is a time consuming function, so we only try to lock */
-
-    if (ngx_mutex_trylock(ngx_crypt_mutex) != NGX_OK) {
-        return NGX_AGAIN;
-    }
-
-#endif
-
     value = crypt((char *) key, (char *) salt);
 
     if (value) {
@@ -81,25 +71,15 @@ ngx_libc_crypt(ngx_pool_t *pool, u_char 
 
         *encrypted = ngx_pnalloc(pool, len);
         if (*encrypted == NULL) {
-#if (NGX_OLD_THREADS && NGX_NONREENTRANT_CRYPT)
-            ngx_mutex_unlock(ngx_crypt_mutex);
-#endif
             return NGX_ERROR;
         }
 
         ngx_memcpy(*encrypted, value, len);
-#if (NGX_OLD_THREADS && NGX_NONREENTRANT_CRYPT)
-        ngx_mutex_unlock(ngx_crypt_mutex);
-#endif
         return NGX_OK;
     }
 
     err = ngx_errno;
 
-#if (NGX_OLD_THREADS && NGX_NONREENTRANT_CRYPT)
-    ngx_mutex_unlock(ngx_crypt_mutex);
-#endif
-
     ngx_log_error(NGX_LOG_CRIT, pool->log, err, "crypt() failed");
 
     return NGX_ERROR;