Home | History | Annotate | Download | only in src

Lines Matching refs:slot

86       loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i];
88 pthread_mutex_init(&slot->lock, NULL);
89 pthread_cond_init(&slot->loc_cb_arrived_cond, NULL);
91 slot->not_available = 0;
92 slot->in_use = 0;
93 slot->loc_handle = -1;
94 slot->loc_cb_wait_event_mask = 0; /* event to wait */
95 slot->loc_cb_received_event_mask = 0; /* received event */
131 loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i];
133 pthread_mutex_lock(&slot->lock);
135 slot->not_available = 1;
137 pthread_mutex_unlock(&slot->lock);
139 pthread_cond_destroy(&slot->loc_cb_arrived_cond);
140 pthread_mutex_destroy(&slot->lock);
203 loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i];
205 pthread_mutex_lock(&slot->lock);
207 if (slot->in_use &&
208 slot->signal_sent == 0 &&
209 slot->loc_handle == loc_handle &&
210 loc_match_callback(slot->loc_cb_wait_event_mask, slot->ioctl_type, loc_event, loc_event_payload))
212 memcpy(&slot->loc_cb_received_payload, loc_event_payload, sizeof (rpc_loc_event_payload_u_type));
214 slot->loc_cb_received_event_mask = loc_event;
216 ALOGV("signal slot %d in_use %d, loc_handle 0x%lx, event_mask 0x%1x, ioctl_type %d", i, slot->in_use, slot->loc_handle, (int) slot->loc_cb_wait_event_mask, (int) slot->ioctl_type);
217 pthread_cond_signal(&slot->loc_cb_arrived_cond);
218 slot->signal_sent = 1;
220 pthread_mutex_unlock(&slot->lock);
226 pthread_mutex_unlock(&slot->lock);
235 Allocates a buffer slot for the synchronous API call
254 loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[i];
255 if (pthread_mutex_trylock(&slot->lock) == EBUSY)
261 if (!slot->in_use && !slot->not_available)
269 /* ALOGV("slot %d in_use = %d, not_available = %d : %d", i, slot->in_use, slot->not_available, i); */
270 pthread_mutex_unlock(&slot->lock);
281 Unlocks a buffer slot
303 Locks a specific slot that was previously locked from loc_lock_a_slot
325 Sets the in_use flag of slot to true or false.
326 Should be called only after the slot is locked
369 int select_id, /* Selected slot */
375 loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[select_id];
377 slot->loc_handle = loc_handle;
379 slot->loc_cb_wait_event_mask = event_mask;
380 slot->ioctl_type = ioctl_type;
381 if (ioctl_type) slot->loc_cb_wait_event_mask |= RPC_LOC_EVENT_IOCTL_REPORT;
451 loc_sync_call_slot_s_type *slot = &loc_sync_data.slots[select_id];
457 while (slot->signal_sent == 0 && rc != ETIMEDOUT) {
458 rc = pthread_cond_timedwait(&slot->loc_cb_arrived_cond,
459 &slot->lock, &expire_time);
470 loc_save_user_payload(callback_payload, ioctl_payload, &slot->loc_cb_received_payload);
510 ALOGE("slot not available ioctl_type = %s",
515 loc_set_slot_in_use(select_id, 1); // set slot in use to true
520 loc_unlock_slot(select_id); // slot is unlocked, but in_use is still true
522 // we want to avoid keeping the slot locked during the loc_ioctl because the rpc
559 loc_set_slot_in_use(select_id, 0); // set slot in use to false