Changeset 261bbdc in mainline for uspace/srv/hid/remcons/remcons.c
- Timestamp:
- 2012-01-12T08:48:51Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 99c2e9f3
- Parents:
- 5923cf82
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/remcons/remcons.c
r5923cf82 r261bbdc 104 104 callid = async_get_call_timeout(&call, 1000); 105 105 106 fibril_mutex_lock(&user-> refcount_mutex);106 fibril_mutex_lock(&user->guard); 107 107 bool bail_out = user->socket_closed || user->task_finished; 108 fibril_mutex_unlock(&user-> refcount_mutex);108 fibril_mutex_unlock(&user->guard); 109 109 110 110 if (bail_out) { … … 134 134 int recv_length = recv(user->socket, user->socket_buffer, BUFFER_SIZE, 0); 135 135 if ((recv_length == 0) || (recv_length == ENOTCONN)) { 136 fibril_mutex_lock(&user-> refcount_mutex);136 fibril_mutex_lock(&user->guard); 137 137 user->socket_closed = true; 138 fibril_mutex_unlock(&user-> refcount_mutex);138 fibril_mutex_unlock(&user->guard); 139 139 async_answer_0(callid, ENOENT); 140 140 return; … … 283 283 telnet_user_error(user, "Spawning %s %s %s failed: %s.", 284 284 APP_GETTERM, term, "/app/bdsh", str_error(rc)); 285 fibril_mutex_lock(&user-> refcount_mutex);285 fibril_mutex_lock(&user->guard); 286 286 user->task_finished = true; 287 287 fibril_condvar_signal(&user->refcount_cv); 288 fibril_mutex_unlock(&user-> refcount_mutex);288 fibril_mutex_unlock(&user->guard); 289 289 return EOK; 290 290 } 291 291 292 fibril_mutex_lock(&user-> refcount_mutex);292 fibril_mutex_lock(&user->guard); 293 293 user->task_id = task; 294 fibril_mutex_unlock(&user-> refcount_mutex);294 fibril_mutex_unlock(&user->guard); 295 295 296 296 task_exit_t task_exit; … … 302 302 303 303 /* Announce destruction. */ 304 fibril_mutex_lock(&user-> refcount_mutex);304 fibril_mutex_lock(&user->guard); 305 305 user->task_finished = true; 306 306 fibril_condvar_signal(&user->refcount_cv); 307 fibril_mutex_unlock(&user-> refcount_mutex);307 fibril_mutex_unlock(&user->guard); 308 308 309 309 return EOK; … … 344 344 345 345 /* Wait for all clients to exit. */ 346 fibril_mutex_lock(&user-> refcount_mutex);346 fibril_mutex_lock(&user->guard); 347 347 while (!user_can_be_destroyed_no_lock(user)) { 348 348 if (user->task_finished) { … … 355 355 } 356 356 } 357 fibril_condvar_wait_timeout(&user->refcount_cv, &user-> refcount_mutex, 1000);358 } 359 fibril_mutex_unlock(&user-> refcount_mutex);357 fibril_condvar_wait_timeout(&user->refcount_cv, &user->guard, 1000); 358 } 359 fibril_mutex_unlock(&user->guard); 360 360 361 361 rc = loc_service_unregister(user->service_id);
Note:
See TracChangeset
for help on using the changeset viewer.