summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2005-10-28 18:06:56 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2005-10-28 18:06:56 +0000
commitf9ab5ddd736458a28b336a5b5c0f2108ad5bb0d3 (patch)
tree5f862d72f3e26bd1ea0eb2ccc301ee6c2ddf5ea5
parentfe8a657cfd9abc7a364e1b31dc658a46985f44e4 (diff)
downloadATCD-f9ab5ddd736458a28b336a5b5c0f2108ad5bb0d3.tar.gz
ChangeLogTag:Fri Oct 28 00:01:06 2005 Ossama Othman <ossama@dre.vanderbilt.edu>
-rw-r--r--ace/SSL/SSL_Context.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/ace/SSL/SSL_Context.cpp b/ace/SSL/SSL_Context.cpp
index bd7af2f3fce..e8e89253460 100644
--- a/ace/SSL/SSL_Context.cpp
+++ b/ace/SSL/SSL_Context.cpp
@@ -65,6 +65,47 @@ extern "C"
// ****************************************************************
+#ifdef ACE_HAS_THREADS
+void
+ACE_SSL_locking_callback (int mode,
+ int type,
+ const char * /* file */,
+ int /* line */)
+{
+ // #ifdef undef
+ // fprintf(stderr,"thread=%4d mode=%s lock=%s %s:%d\n",
+ // CRYPTO_thread_id(),
+ // (mode&CRYPTO_LOCK)?"l":"u",
+ // (type&CRYPTO_READ)?"r":"w",file,line);
+ // #endif
+ // /*
+ // if (CRYPTO_LOCK_SSL_CERT == type)
+ // fprintf(stderr,"(t,m,f,l) %ld %d %s %d\n",
+ // CRYPTO_thread_id(),
+ // mode,file,line);
+ // */
+ if (mode & CRYPTO_LOCK)
+ ACE_OS::mutex_lock (&(ACE_SSL_Context::lock_[type]));
+ else
+ ACE_OS::mutex_unlock (&(ACE_SSL_Context::lock_[type]));
+}
+
+// -------------------------------
+
+extern "C"
+{
+ /// Return the current thread ID. OpenSSL uses this on platforms
+ /// that need it.
+ unsigned long
+ ACE_SSL_thread_id (void)
+ {
+ return (unsigned long) ACE_OS::thr_self ();
+ }
+}
+#endif /* ACE_HAS_THREADS */
+
+// ****************************************************************
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#ifdef ACE_HAS_THREADS