summaryrefslogtreecommitdiff
path: root/ext/standard/php_crypt_r.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2010-06-17 10:22:03 +0000
committerPierre Joye <pajoye@php.net>2010-06-17 10:22:03 +0000
commit377ffeb50af09eed7cf2b9cf0a774ecfb3a2779b (patch)
treee6ef2b48edacc26da38279b5ea65cbfa1310f372 /ext/standard/php_crypt_r.c
parentbc226fafed9149734c1a9b55e847ca54d863ab37 (diff)
downloadphp-git-377ffeb50af09eed7cf2b9cf0a774ecfb3a2779b.tar.gz
- #51424, solaris part
Diffstat (limited to 'ext/standard/php_crypt_r.c')
-rw-r--r--ext/standard/php_crypt_r.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c
index 4872c49599..cd47bfe123 100644
--- a/ext/standard/php_crypt_r.c
+++ b/ext/standard/php_crypt_r.c
@@ -42,7 +42,11 @@
# include <Wincrypt.h>
#endif
-#include <signal.h>
+#ifdef HAVE_ATOMIC_H /* Solaris 10 defines atomic API within */
+# include <atomic.h>
+#else
+# include <signal.h>
+#endif
#include "php_crypt_r.h"
#include "crypt_freesec.h"
@@ -77,6 +81,8 @@ void _crypt_extended_init_r(void)
{
#ifdef PHP_WIN32
LONG volatile initialized = 0;
+#elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
+ volatile unsigned int initialized = 0;
#else
static volatile sig_atomic_t initialized = 0;
#endif
@@ -90,6 +96,9 @@ void _crypt_extended_init_r(void)
InterlockedIncrement(&initialized);
#elif (defined(__GNUC__) && (__GNUC__ >= 4 && __GNUC_MINOR >= 2))
__sync_fetch_and_add(&initialized, 1);
+#elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
+ membar_producer();
+ atomic_add_int(&initialized, 1);
#endif
_crypt_extended_init();
}