Lines Matching refs:slot

91 		// when slot in use
109 // when slot unused
242 uint32 slot = num % sMaxSems;
243 if (sSems[slot].id != (int)num) {
248 dump_sem(&sSems[slot]);
268 /*! \brief Appends a semaphore slot to the free list.
271 The slot's id field is not changed. It should already be set to -1.
273 \param slot The index of the semaphore slot.
274 \param nextID The ID the slot will get when reused. If < 0 the \a slot
278 free_sem_slot(int slot, sem_id nextID)
280 struct sem_entry *sem = sSems + slot;
283 sem->u.unused.next_id = slot;
344 // append slot to the free list
359 int32 slot = id % sMaxSems;
363 SpinLocker semLocker(sSems[slot].lock);
365 if (sSems[slot].id != id) {
371 && sSems[slot].u.used.owner == team_get_kernel_team_id()) {
377 if (sSems[slot].u.used.owner >= 0) {
378 list_remove_link(&sSems[slot].u.used.team_link);
379 sSems[slot].u.used.owner = -1;
386 uninit_sem_locked(sSems[slot], &name, semLocker);
499 // get the first slot from the free list
507 // init the slot
545 int32 slot = id % sMaxSems;
547 InterruptsSpinLocker _(&sSems[slot].lock);
549 if (sSems[slot].id != id) {
553 && sSems[slot].u.used.owner == team_get_kernel_team_id()) {
560 info->next = sSems[slot].u.used.select_infos;
561 sSems[slot].u.used.select_infos = info;
563 if (sSems[slot].u.used.count > 0)
581 int32 slot = id % sMaxSems;
583 InterruptsSpinLocker _(&sSems[slot].lock);
585 if (sSems[slot].id == id) {
586 select_info** infoLocation = &sSems[slot].u.used.select_infos;
730 int slot = id % sMaxSems;
751 SpinLocker semLocker(sSems[slot].lock);
753 if (sSems[slot].id != id) {
761 && sSems[slot].u.used.owner == team_get_kernel_team_id()) {
770 if (sSems[slot].u.used.count - count < 0) {
784 if ((sSems[slot].u.used.count -= count) < 0) {
789 " name = %s\n", id, sSems[slot].u.used.name, thread, thread->name));
796 sSems[slot].u.used.count += count;
812 sSems[slot].queue.Add(&queueEntry);
834 remove_thread_from_sem(&queueEntry, &sSems[slot]);
837 sSems[slot].u.used.last_acquirer = thread_get_current_thread_id();
839 sSems[slot].u.used.last_acquire_count = count;
846 "thread %ld (%s)\n", id, sSems[slot].u.used.name, thread->id,
851 sSems[slot].u.used.net_count -= count;
852 sSems[slot].u.used.last_acquirer = thread_get_current_thread_id();
854 sSems[slot].u.used.last_acquire_count = count;
874 int32 slot = id % sMaxSems;
892 SpinLocker semLocker(sSems[slot].lock);
894 if (sSems[slot].id != id) {
902 && sSems[slot].u.used.owner == team_get_kernel_team_id()) {
911 sSems[slot].u.used.last_acquirer = -sSems[slot].u.used.last_acquirer;
913 sSems[slot].u.used.last_releaser = thread_get_current_thread_id();
914 sSems[slot].u.used.last_release_count = count;
922 count = sSems[slot].u.used.net_count - sSems[slot].u.used.count;
936 queued_thread* entry = sSems[slot].queue.Head();
939 sSems[slot].u.used.count += count;
940 sSems[slot].u.used.net_count += count;
949 if (entry->count > (sSems[slot].u.used.net_count + count)) {
950 sSems[slot].u.used.count += count;
951 sSems[slot].u.used.net_count += count;
958 sSems[slot].u.used.count += delta;
959 sSems[slot].u.used.net_count += delta - entry->count;
964 sSems[slot].u.used.count += entry->count;
967 sSems[slot].queue.Remove(entry);
971 if (sSems[slot].u.used.count > 0)
972 notify_sem_select_events(&sSems[slot], B_EVENT_ACQUIRE_SEMAPHORE);
997 int slot = id % sMaxSems;
999 InterruptsSpinLocker _(sSems[slot].lock);
1001 if (sSems[slot].id != id) {
1006 *_count = sSems[slot].u.used.count;
1023 int slot = id % sMaxSems;
1025 InterruptsSpinLocker _(sSems[slot].lock);
1027 if (sSems[slot].id != id) {
1031 fill_sem_info(&sSems[slot], info, size);
1101 int32 slot = id % sMaxSems;
1110 SpinLocker semLocker(sSems[slot].lock);
1112 if (sSems[slot].id != id) {
1117 list_remove_link(&sSems[slot].u.used.team_link);
1118 list_add_item(&newTeam->sem_list, &sSems[slot].u.used.team_link);
1120 sSems[slot].u.used.owner = newTeam->id;
1131 int slot = id % sMaxSems;
1133 if (sSemsActive == false || id < 0 || sSems[slot].id != id)
1136 return sSems[slot].u.used.name;