summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexandra Ellwood <lxs@mit.edu>2008-02-05 18:18:41 +0000
committerAlexandra Ellwood <lxs@mit.edu>2008-02-05 18:18:41 +0000
commit23378da7704a0c1dfd58ab46289036b509ee4d9f (patch)
tree2ce392f6a1ceda0988f3cc5cc80b5b62a5254ed6 /src
parent85df09ef7fa81dc4db8490740cbf8e989204791c (diff)
downloadkrb5-23378da7704a0c1dfd58ab46289036b509ee4d9f.tar.gz
krb5-23378da7704a0c1dfd58ab46289036b509ee4d9f.tar.xz
krb5-23378da7704a0c1dfd58ab46289036b509ee4d9f.zip
Set EOL style
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20216 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/ccapi/test/simple_lock_test.c166
1 files changed, 83 insertions, 83 deletions
diff --git a/src/ccapi/test/simple_lock_test.c b/src/ccapi/test/simple_lock_test.c
index 254663c3a..d51a58660 100644
--- a/src/ccapi/test/simple_lock_test.c
+++ b/src/ccapi/test/simple_lock_test.c
@@ -1,84 +1,84 @@
-/*
- simple_lock_test.c
-
- Initializes two contexts in two different threads and tries to get read locks on both at the same time.
- Hangs at line 24.
-*/
-#include <stdio.h>
-#include <stdarg.h>
-
-#include "cci_debugging.h"
-
-#ifdef TARGET_OS_MAC
-#include <stdlib.h>
-#include <Kerberos/CredentialsCache.h>
-#else
-#include "CredentialsCache.h"
-#endif
-
-
-void * other_thread () {
- cc_int32 err;
- cc_context_t context = NULL;
-
- err = cc_initialize(&context, ccapi_version_7, NULL, NULL);
-
- cci_debug_printf("thread: attempting lock. may hang. err == %d", err);
-
- if (!err) {
- // hangs with cc_lock_read which should succeed immediately, but does not hang with write, upgrade, and downgrade, which fail immediately
- err = cc_context_lock(context, cc_lock_read, cc_lock_noblock);
- }
-
- if (context) {
- cc_context_unlock(context);
- cc_context_release(context);
- context = NULL;
- }
- cci_debug_printf("thread: return. err == %d", err);
- }
-
-
-int main (int argc, char *argv[]) {
- cc_int32 err;
- int status;
- cc_context_t context = NULL;
-
-#ifdef TARGET_OS_MAC
- pthread_t thread_id;
-#endif
-
- err = cc_initialize(&context, ccapi_version_7, NULL, NULL);
- if (!err) {
- err = cc_context_lock(context, cc_lock_read, cc_lock_noblock);
- }
-
- cci_debug_printf("main: initialized and read locked context. err == %d", err);
-
-#ifdef TARGET_OS_MAC
- status = pthread_create (&thread_id, NULL, (void *) other_thread, NULL);
- if (status != 0) {
- cci_debug_printf("Create error!");
- exit(-1);
- }
-
- pthread_join(thread_id, NULL);
-#else
-
-#endif
-
- cci_debug_printf("main: unlocking and releasing context. err == %d", err);
-
- if (context) {
- cci_debug_printf("main: calling cc_context_unlock");
- cc_context_unlock(context);
- cci_debug_printf("main: calling cc_context_release");
- cc_context_release(context);
- context = NULL;
- }
-
- cci_debug_printf("main: return. err == %d", err);
-
- UNREFERENCED_PARAMETER(status); // no whining!
- return 0;
+/*
+ simple_lock_test.c
+
+ Initializes two contexts in two different threads and tries to get read locks on both at the same time.
+ Hangs at line 24.
+*/
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "cci_debugging.h"
+
+#ifdef TARGET_OS_MAC
+#include <stdlib.h>
+#include <Kerberos/CredentialsCache.h>
+#else
+#include "CredentialsCache.h"
+#endif
+
+
+void * other_thread () {
+ cc_int32 err;
+ cc_context_t context = NULL;
+
+ err = cc_initialize(&context, ccapi_version_7, NULL, NULL);
+
+ cci_debug_printf("thread: attempting lock. may hang. err == %d", err);
+
+ if (!err) {
+ // hangs with cc_lock_read which should succeed immediately, but does not hang with write, upgrade, and downgrade, which fail immediately
+ err = cc_context_lock(context, cc_lock_read, cc_lock_noblock);
+ }
+
+ if (context) {
+ cc_context_unlock(context);
+ cc_context_release(context);
+ context = NULL;
+ }
+ cci_debug_printf("thread: return. err == %d", err);
+ }
+
+
+int main (int argc, char *argv[]) {
+ cc_int32 err;
+ int status;
+ cc_context_t context = NULL;
+
+#ifdef TARGET_OS_MAC
+ pthread_t thread_id;
+#endif
+
+ err = cc_initialize(&context, ccapi_version_7, NULL, NULL);
+ if (!err) {
+ err = cc_context_lock(context, cc_lock_read, cc_lock_noblock);
+ }
+
+ cci_debug_printf("main: initialized and read locked context. err == %d", err);
+
+#ifdef TARGET_OS_MAC
+ status = pthread_create (&thread_id, NULL, (void *) other_thread, NULL);
+ if (status != 0) {
+ cci_debug_printf("Create error!");
+ exit(-1);
+ }
+
+ pthread_join(thread_id, NULL);
+#else
+
+#endif
+
+ cci_debug_printf("main: unlocking and releasing context. err == %d", err);
+
+ if (context) {
+ cci_debug_printf("main: calling cc_context_unlock");
+ cc_context_unlock(context);
+ cci_debug_printf("main: calling cc_context_release");
+ cc_context_release(context);
+ context = NULL;
+ }
+
+ cci_debug_printf("main: return. err == %d", err);
+
+ UNREFERENCED_PARAMETER(status); // no whining!
+ return 0;
} \ No newline at end of file