summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-11-25 00:05:21 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-11-27 23:00:09 +0100
commit1d767442294df64b9746f02cd6fcf320da257b1f (patch)
tree545058ea2a191721820a41b5c8b6101bc1f65064
parent1de0643c9218db536f5b2e294bbfa653c77438e4 (diff)
Complete switch from cthreads to pthreads
* console/input.c: Switch comment from cthreads to pthreads. * libnetfs/file-get-fs-options.c: Likewise * libnetfs/fsys-get-options.c: Likewise * libnetfs/fsys-set-options.c: Likewise * libnetfs/shutdown.c: Likewise * libpager/lock-object.c: Likewise * nfsd/cache.c: Set back replycachelock as static variable. * term/hurdio.c: Use pthread_hurd_cond_wait_np instead of pthread_cond_wait.
-rw-r--r--console/input.c2
-rw-r--r--libnetfs/file-get-fs-options.c4
-rw-r--r--libnetfs/fsys-get-options.c4
-rw-r--r--libnetfs/fsys-set-options.c8
-rw-r--r--libnetfs/shutdown.c6
-rw-r--r--libpager/lock-object.c4
-rw-r--r--nfsd/cache.c2
-rw-r--r--term/hurdio.c4
8 files changed, 17 insertions, 17 deletions
diff --git a/console/input.c b/console/input.c
index 7ebac302..91f21c15 100644
--- a/console/input.c
+++ b/console/input.c
@@ -181,7 +181,7 @@ ssize_t input_enqueue (input_t input, int nonblock, char *data,
input->full = 1;
if (was_empty)
pthread_cond_broadcast (&input->data_available);
- /* Prevent calling condition_broadcast again if nonblock. */
+ /* Prevent calling pthread_cond_broadcast again if nonblock. */
was_empty = 0;
}
else
diff --git a/libnetfs/file-get-fs-options.c b/libnetfs/file-get-fs-options.c
index 1a18c72d..a8029916 100644
--- a/libnetfs/file-get-fs-options.c
+++ b/libnetfs/file-get-fs-options.c
@@ -44,11 +44,11 @@ netfs_S_file_get_fs_options (struct protid *user,
if (! err)
{
#if NOT_YET
- rwlock_reader_lock (&netfs_fsys_lock);
+ pthread_rwlock_rdlock (&netfs_fsys_lock);
#endif
err = netfs_append_args (&argz, &argz_len);
#if NOT_YET
- rwlock_reader_unlock (&netfs_fsys_lock);
+ pthread_rwlock_unlock (&netfs_fsys_lock);
#endif
}
diff --git a/libnetfs/fsys-get-options.c b/libnetfs/fsys-get-options.c
index fa045eff..54bd9a00 100644
--- a/libnetfs/fsys-get-options.c
+++ b/libnetfs/fsys-get-options.c
@@ -49,11 +49,11 @@ netfs_S_fsys_get_options (fsys_t fsys,
if (! err)
{
#if NOT_YET
- rwlock_reader_lock (&netfs_fsys_lock);
+ pthread_rwlock_rdlock (&netfs_fsys_lock);
#endif
err = netfs_append_args (&argz, &argz_len);
#if NOT_YET
- rwlock_reader_unlock (&netfs_fsys_lock);
+ pthread_rwlock_unlock (&netfs_fsys_lock);
#endif
}
diff --git a/libnetfs/fsys-set-options.c b/libnetfs/fsys-set-options.c
index 9dd8b007..d7dc743b 100644
--- a/libnetfs/fsys-set-options.c
+++ b/libnetfs/fsys-set-options.c
@@ -70,20 +70,20 @@ netfs_S_fsys_set_options (fsys_t fsys,
#if NOT_YET
if (do_children)
{
- rwlock_writer_lock (&netfs_fsys_lock);
+ pthread_rwlock_wrlock (&netfs_fsys_lock);
err = netfs_node_iterate (helper);
- rwlock_writer_unlock (&netfs_fsys_lock);
+ pthread_rwlock_unlock (&netfs_fsys_lock);
}
#endif
if (!err)
{
#if NOT_YET
- rwlock_writer_lock (&netfs_fsys_lock);
+ pthread_rwlock_wrlock (&netfs_fsys_lock);
#endif
err = netfs_set_options (data, data_len);
#if NOT_YET
- rwlock_writer_unlock (&netfs_fsys_lock);
+ pthread_rwlock_unlock (&netfs_fsys_lock);
#endif
}
diff --git a/libnetfs/shutdown.c b/libnetfs/shutdown.c
index b3463bfc..94d4b207 100644
--- a/libnetfs/shutdown.c
+++ b/libnetfs/shutdown.c
@@ -70,7 +70,7 @@ netfs_shutdown (int flags)
#endif
#ifdef NOTYET
- rwlock_writer_lock (&netfs_fsys_lock);
+ pthread_rwlock_wrlock (&netfs_fsys_lock);
#endif
/* Permit all current RPC's to finish, and then suspend any new ones. */
@@ -78,7 +78,7 @@ netfs_shutdown (int flags)
if (err)
{
#ifdef NOTYET
- rwlock_writer_unlock (&netfs_fsys_lock);
+ pthread_rwlock_unlock (&netfs_fsys_lock);
#endif
return err;
}
@@ -90,7 +90,7 @@ netfs_shutdown (int flags)
ports_enable_class (netfs_protid_class);
ports_resume_class_rpcs (netfs_protid_class);
#ifdef NOTYET
- rwlock_writer_unlock (&netfs_fsys_lock);
+ pthread_rwlock_unlock (&netfs_fsys_lock);
#endif
return EBUSY;
}
diff --git a/libpager/lock-object.c b/libpager/lock-object.c
index 93c89f07..c022d0c4 100644
--- a/libpager/lock-object.c
+++ b/libpager/lock-object.c
@@ -65,11 +65,11 @@ _pager_lock_object (struct pager *p,
}
}
- mutex_unlock (&p->interlock);
+ pthread_mutex_unlock (&p->interlock);
memory_object_lock_request (p->memobjcntl, offset, size, should_return,
should_flush, lock_value,
sync ? p->port.port_right : MACH_PORT_NULL);
- mutex_lock (&p->interlock);
+ pthread_mutex_lock (&p->interlock);
if (sync)
{
diff --git a/nfsd/cache.c b/nfsd/cache.c
index 060cc738..5b94e71d 100644
--- a/nfsd/cache.c
+++ b/nfsd/cache.c
@@ -465,7 +465,7 @@ create_cached_handle (int fs, struct cache_handle *credc, file_t userport)
static struct cached_reply *replyhashtable [REPLYHASH_TABLE_SIZE];
-pthread_spinlock_t replycachelock = PTHREAD_SPINLOCK_INITIALIZER;
+static pthread_spinlock_t replycachelock = PTHREAD_SPINLOCK_INITIALIZER;
static int nfreereplies;
static int leastreplylastuse;
diff --git a/term/hurdio.c b/term/hurdio.c
index 368c2322..dfade0e6 100644
--- a/term/hurdio.c
+++ b/term/hurdio.c
@@ -147,7 +147,7 @@ static void
wait_for_dtr (void)
{
while (!assert_dtr)
- pthread_cond_wait (&hurdio_assert_dtr_condition, &global_lock);
+ pthread_hurd_cond_wait_np (&hurdio_assert_dtr_condition, &global_lock);
assert_dtr = 0;
if (tty_arg == 0)
@@ -262,7 +262,7 @@ hurdio_writer_loop (void *arg)
while (writer_thread != MACH_PORT_NULL
&& (ioport == MACH_PORT_NULL || !qsize (outputq)
|| output_stopped))
- pthread_cond_wait (&hurdio_writer_condition, &global_lock);
+ pthread_hurd_cond_wait_np (&hurdio_writer_condition, &global_lock);
if (writer_thread == MACH_PORT_NULL) /* A sign to die. */
return 0;