diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-02-11 23:38:09 +0000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-02-11 23:38:09 +0000 |
commit | c159a059bdc152931e22f2e86553acb25c78183a (patch) | |
tree | bcef5c40fbde6952bd60e0e139bdceb52de2fa09 /node.c | |
parent | 7993b3db57070ec6b37bdac13f9edf9362861f16 (diff) |
Fix build against libpthread
* Makefile.am (nsmux_LDADD): Link against libpthread instead of
libthreads.
* nsmux.h: Include <pthread.h> instead of <cthreads.h>
* lnode.h: Use pthread type instead of cthreads structure.
* node.h: Likewise.
* ncache.h: Likewise.
* lnode.c: Use pthread functions instead of cthreads functions.
* node.c: Likewise.
* ncache.c: Likewise.
* nsmux.c: Likewise.
Diffstat (limited to 'node.c')
-rw-r--r-- | node.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -46,7 +46,7 @@ /*---------------------------------------------------------------------------*/ /*--------Global Variables---------------------------------------------------*/ /*The lock protecting the underlying filesystem*/ -struct mutex ulfs_lock = MUTEX_INITIALIZER; +pthread_mutex_t ulfs_lock = PTHREAD_MUTEX_INITIALIZER; /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/ @@ -246,7 +246,7 @@ void node_destroy (node_t * np) { if (np->nn->lnode->node == np) { - mutex_lock (&np->nn->lnode->lock); + pthread_mutex_lock (&np->nn->lnode->lock); /*orphan the light node */ np->nn->lnode->node = NULL; @@ -290,7 +290,7 @@ error_t node_create_root (node_t ** root_node) } /*Release the lock on the lnode */ - mutex_unlock (&lnode->lock); + pthread_mutex_unlock (&lnode->lock); /*Store the result in the parameter */ *root_node = node; @@ -307,7 +307,7 @@ error_t node_init_root (node_t * node /*the root node */ error_t err = 0; /*Acquire a lock for operations on the underlying filesystem */ - mutex_lock (&ulfs_lock); + pthread_mutex_lock (&ulfs_lock); /*Open the port to the directory specified in `dir` */ node->nn->port = file_name_lookup (dir, O_READ | O_DIRECTORY, 0); @@ -320,7 +320,7 @@ error_t node_init_root (node_t * node /*the root node */ LOG_MSG ("node_init_root: Could not open the port for %s.", dir); /*release the lock and stop */ - mutex_unlock (&ulfs_lock); + pthread_mutex_unlock (&ulfs_lock); return err; } @@ -337,7 +337,7 @@ error_t node_init_root (node_t * node /*the root node */ LOG_MSG ("node_init_root: Could not stat the root node."); /*unlock the mutex and exit */ - mutex_unlock (&ulfs_lock); + pthread_mutex_unlock (&ulfs_lock); return err; } @@ -349,7 +349,7 @@ error_t node_init_root (node_t * node /*the root node */ PORT_DEALLOC (node->nn->port); /*unlock the mutex */ - mutex_unlock (&ulfs_lock); + pthread_mutex_unlock (&ulfs_lock); LOG_MSG ("node_init_root: Could not strdup the directory."); return ENOMEM; @@ -392,7 +392,7 @@ error_t node_init_root (node_t * node /*the root node */ PORT_DEALLOC (node->nn->port); /*unlock the mutex */ - mutex_unlock (&ulfs_lock); + pthread_mutex_unlock (&ulfs_lock); LOG_MSG ("node_init_root: Could not strdup the name of the root node."); return ENOMEM; @@ -402,7 +402,7 @@ error_t node_init_root (node_t * node /*the root node */ node->nn->lnode->name_len = strlen (p); /*Release the lock for operations on the undelying filesystem */ - mutex_unlock (&ulfs_lock); + pthread_mutex_unlock (&ulfs_lock); /*Return the result of operations */ return err; @@ -557,13 +557,13 @@ error_t node_update (node_t * node) return err; /*return 0; actually */ /*Gain exclusive access to the root node of the filesystem */ - mutex_lock (&netfs_root_node->lock); + pthread_mutex_lock (&netfs_root_node->lock); /*Construct the full path to `node` */ err = lnode_path_construct (node->nn->lnode, &path); if (err) { - mutex_unlock (&netfs_root_node->lock); + pthread_mutex_unlock (&netfs_root_node->lock); return err; } @@ -611,7 +611,7 @@ error_t node_update (node_t * node) node->nn->flags |= FLAG_NODE_ULFS_UPTODATE; /*Release the lock on the root node of proxy filesystem */ - mutex_unlock (&netfs_root_node->lock); + pthread_mutex_unlock (&netfs_root_node->lock); /*Return the result of operations */ return err; |