Home | History | Annotate | Download | only in loc_api_v02

Lines Matching refs:slot

121       loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i];
123 pthread_mutex_init(&slot->sync_req_lock, NULL);
124 pthread_cond_init(&slot->ind_arrived_cond, NULL);
126 slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE;
127 slot->ind_is_selected = false; /* is ind selected? */
128 slot->ind_is_waiting = false; /* is waiting? */
129 slot->ind_has_arrived = false; /* callback has arrived */
130 slot->recv_ind_id = 0; /* ind to wait for */
131 slot->recv_ind_payload_ptr = NULL;
132 slot->req_id = 0; /* req id */
182 loc_sync_req_data_s_type *slot = &loc_sync_array.slots[i];
186 pthread_mutex_lock(&slot->sync_req_lock);
188 if ( (loc_sync_array.slot_in_use[i]) && (slot->client_handle == client_handle)
189 && (ind_id == slot->recv_ind_id) && (!slot->ind_has_arrived))
191 // copy the payload to the slot waiting for this ind
194 LOC_LOGV("%s:%d]: found slot %d selected for ind %u \n",
198 NULL != slot->recv_ind_payload_ptr && NULL != ind_payload_ptr)
203 memcpy(slot->recv_ind_payload_ptr, ind_payload_ptr, payload_size);
209 if (slot->ind_is_waiting)
211 slot->recv_ind_id = ind_id;
213 pthread_cond_signal(&slot->ind_arrived_cond);
221 slot->ind_has_arrived = true;
224 pthread_mutex_unlock(&slot->sync_req_lock);
239 Allocates a buffer slot for the synchronous API call
270 LOC_LOGV("%s:%d]: returning slot %d\n",
280 Frees a buffer slot after the synchronous API call
295 loc_sync_req_data_s_type *slot;
299 LOC_LOGD("%s:%d]: freeing slot %d\n", __func__, __LINE__, select_id);
303 slot = &loc_sync_array.slots[select_id];
305 slot->client_handle = LOC_CLIENT_INVALID_HANDLE_VALUE;
306 slot->ind_is_selected = false; /* is ind selected? */
307 slot->ind_is_waiting = false; /* is waiting? */
308 slot->ind_has_arrived = false; /* callback has arrived */
309 slot->recv_ind_id = 0; /* ind to wait for */
310 slot->recv_ind_payload_ptr = NULL;
311 slot->req_id = 0;
365 loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id];
367 pthread_mutex_lock(&slot->sync_req_lock);
369 slot->client_handle = client_handle;
370 slot->ind_is_selected = true;
371 slot->ind_is_waiting = false;
372 slot->ind_has_arrived = false;
374 slot->recv_ind_id = ind_id;
375 slot->req_id = req_id;
376 slot->recv_ind_payload_ptr = ind_payload_ptr; //store the payload ptr
378 pthread_mutex_unlock(&slot->sync_req_lock);
417 loc_sync_req_data_s_type *slot = &loc_sync_array.slots[select_id];
425 pthread_mutex_lock(&slot->sync_req_lock);
429 if (slot->ind_has_arrived)
435 if (slot->ind_is_waiting)
437 LOC_LOGW("%s:%d]: already waiting in this slot %d\n", __func__,
450 slot->ind_is_waiting = true;
453 rc = pthread_cond_timedwait(&slot->ind_arrived_cond,
454 &slot->sync_req_lock, &expire_time);
456 slot->ind_is_waiting = false;
460 LOC_LOGE("%s:%d]: slot %d, timed out for ind_id %s\n",
467 pthread_mutex_unlock(&slot->sync_req_lock);