Lines Matching refs:count

74 	queued_thread(Thread *thread, int32 count)
77 count(count),
83 int32 count;
94 int32 count;
96 // count + acquisition count of all blocked
152 kprintf("%-*s id count team last name\n", B_PRINTF_POINTER_WIDTH,
165 " %s\n", sem, sem->id, sem->u.used.count,
183 kprintf("count: %" B_PRId32 "\n", sem->u.used.count);
198 kprintf("last acquired by: %" B_PRId32 ", count: %" B_PRId32 "\n",
200 kprintf("last released by: %" B_PRId32 ", count: %" B_PRId32 "\n",
313 info->count = sem->u.used.count;
469 create_sem_etc(int32 count, const char* name, team_id owner)
510 sem->u.used.count = count;
511 sem->u.used.net_count = count;
524 KTRACE("create_sem_etc(count: %ld, name: %s, owner: %ld) -> %ld",
525 count, name, owner, id);
563 if (sSems[slot].u.used.count > 0)
610 sem->u.used.count += entry->count;
622 // The thread is still waiting. If its count is satisfied, unblock
624 if (entry->count > sem->u.used.net_count)
628 sem->u.used.net_count -= entry->count;
632 sem->u.used.count += entry->count;
640 if (sem->u.used.count > 0)
692 create_sem(int32 count, const char* name)
694 return create_sem_etc(count, name, team_get_kernel_team_id());
713 acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout)
715 return switch_sem_etc(-1, id, count, flags, timeout);
727 switch_sem_etc(sem_id semToBeReleased, sem_id id, int32 count,
745 if (count <= 0
770 if (sSems[slot].u.used.count - count < 0) {
780 KTRACE("switch_sem_etc(semToBeReleased: %ld, sem: %ld, count: %ld, "
781 "flags: 0x%lx, timeout: %lld)", semToBeReleased, id, count, flags,
784 if ((sSems[slot].u.used.count -= count) < 0) {
796 sSems[slot].u.used.count += count;
811 queued_thread queueEntry(thread, count);
839 sSems[slot].u.used.last_acquire_count = count;
851 sSems[slot].u.used.net_count -= count;
854 sSems[slot].u.used.last_acquire_count = count;
872 release_sem_etc(sem_id id, int32 count, uint32 flags)
882 if (count <= 0 && (flags & B_RELEASE_ALL) == 0)
908 KTRACE("release_sem_etc(sem: %ld, count: %ld, flags: 0x%lx)", id, count,
914 sSems[slot].u.used.last_release_count = count;
919 if (count < 0)
920 unblockStatus = count;
922 count = sSems[slot].u.used.net_count - sSems[slot].u.used.count;
925 if (count == 0)
935 while (count > 0) {
939 sSems[slot].u.used.count += count;
940 sSems[slot].u.used.net_count += count;
947 // The thread is still waiting. If its count is satisfied,
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;
957 int delta = min_c(count, entry->count);
958 sSems[slot].u.used.count += delta;
959 sSems[slot].u.used.net_count += delta - entry->count;
960 count -= delta;
964 sSems[slot].u.used.count += entry->count;
971 if (sSems[slot].u.used.count > 0)
1006 *_count = sSems[slot].u.used.count;
1144 _user_create_sem(int32 count, const char *userName)
1149 return create_sem_etc(count, NULL, team_get_current_team_id());
1155 return create_sem_etc(count, name, team_get_current_team_id());
1177 _user_acquire_sem_etc(sem_id id, int32 count, uint32 flags, bigtime_t timeout)
1181 status_t error = switch_sem_etc(-1, id, count,
1202 _user_switch_sem_etc(sem_id releaseSem, sem_id id, int32 count, uint32 flags,
1208 status_t error = switch_sem_etc(releaseSem, id, count,
1226 _user_release_sem_etc(sem_id id, int32 count, uint32 flags)
1228 return release_sem_etc(id, count, flags | B_CHECK_PERMISSION);
1236 int32 count;
1241 status = get_sem_count(id, &count);
1242 if (status == B_OK && user_memcpy(userCount, &count, sizeof(int32)) < B_OK)