Changeset 8b5c8ae in mainline
- Timestamp:
- 2011-01-09T20:44:24Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 622dea8
- Parents:
- 80bffdb0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async_sess.c
r80bffdb0 r8b5c8ae 110 110 typedef struct { 111 111 link_t sess_link; /**< Link for the session list of inactive connections. */ 112 link_t global_link; /**< Link for the global list of inactive connecti nos. */112 link_t global_link; /**< Link for the global list of inactive connections. */ 113 113 int data_phone; /**< Connected data phone. */ 114 114 } conn_node_t; 115 115 116 116 /** 117 * Mutex protecting the inactive_conn_head list and the session list. 117 * Mutex protecting the inactive_conn_head list, the session list and the 118 * avail_phone condition variable. 118 119 */ 119 120 static fibril_mutex_t async_sess_mutex; … … 128 129 */ 129 130 static LIST_INITIALIZE(session_list_head); 131 132 /** 133 * Condition variable used to wait for a phone to become available. 134 */ 135 static FIBRIL_CONDVAR_INITIALIZE(avail_phone_cv); 130 136 131 137 /** Initialize the async_sess subsystem. … … 197 203 free(conn); 198 204 } 205 206 fibril_condvar_broadcast(&avail_phone_cv); 199 207 } 200 208 … … 256 264 } else { 257 265 /* 258 * This is unfortunate. We failed both to find a cached 259 * connection or to create a new one even after cleaning up 260 * the cache. This is most likely due to too many 261 * open sessions (connected session phones). 266 * Wait for a phone to become available. 262 267 */ 263 data_phone = ELIMIT; 268 fibril_condvar_wait(&avail_phone_cv, &async_sess_mutex); 269 goto retry; 264 270 } 265 271 } … … 279 285 280 286 fibril_mutex_lock(&async_sess_mutex); 287 fibril_condvar_signal(&avail_phone_cv); 281 288 conn = (conn_node_t *) malloc(sizeof(conn_node_t)); 282 289 if (!conn) { … … 285 292 * means that we simply hang up. 286 293 */ 294 ipc_hangup(data_phone); 287 295 fibril_mutex_unlock(&async_sess_mutex); 288 ipc_hangup(data_phone);289 296 return; 290 297 }
Note:
See TracChangeset
for help on using the changeset viewer.