Changeset 622dea8 in mainline
- Timestamp:
- 2011-01-09T21:14:19Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7ea7db31
- Parents:
- 8b5c8ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/devman.c
r8b5c8ae r622dea8 42 42 #include <devman.h> 43 43 #include <async.h> 44 #include <fibril_synch.h> 44 45 #include <errno.h> 45 46 #include <malloc.h> … … 50 51 static int devman_phone_client = -1; 51 52 53 static FIBRIL_MUTEX_INITIALIZE(devman_phone_mutex); 54 52 55 int devman_get_phone(devman_interface_t iface, unsigned int flags) 53 56 { 54 57 switch (iface) { 55 58 case DEVMAN_DRIVER: 56 if (devman_phone_driver >= 0) 59 fibril_mutex_lock(&devman_phone_mutex); 60 if (devman_phone_driver >= 0) { 61 fibril_mutex_unlock(&devman_phone_mutex); 57 62 return devman_phone_driver; 63 } 58 64 59 65 if (flags & IPC_FLAG_BLOCKING) … … 64 70 SERVICE_DEVMAN, DEVMAN_DRIVER, 0); 65 71 72 fibril_mutex_unlock(&devman_phone_mutex); 66 73 return devman_phone_driver; 67 74 case DEVMAN_CLIENT: 68 if (devman_phone_client >= 0) 75 fibril_mutex_lock(&devman_phone_mutex); 76 if (devman_phone_client >= 0) { 77 fibril_mutex_unlock(&devman_phone_mutex); 69 78 return devman_phone_client; 79 } 70 80 71 81 if (flags & IPC_FLAG_BLOCKING) … … 75 85 devman_phone_client = async_connect_me_to(PHONE_NS, 76 86 SERVICE_DEVMAN, DEVMAN_CLIENT, 0); 77 87 fibril_mutex_unlock(&devman_phone_mutex); 88 89 fibril_mutex_unlock(&devman_phone_mutex); 78 90 return devman_phone_client; 79 91 default:
Note:
See TracChangeset
for help on using the changeset viewer.