Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
firejox committed May 11, 2023
1 parent 18bf887 commit cf73f14
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions include/fjx-fiber/internal/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ struct fjx_fiber_scheduler__ {
fjx_work_thread main_th;
};

DLL_LOCAL fjx_fiber *get_avaiable_fiber_unsafe(fjx_fiber_scheduler *);
DLL_LOCAL fjx_fiber_memory *get_avaiable_memory(fjx_fiber_scheduler *);
DLL_LOCAL fjx_fiber *get_available_fiber_unsafe(fjx_fiber_scheduler *);
DLL_LOCAL fjx_fiber_memory *get_available_memory(fjx_fiber_scheduler *);
DLL_LOCAL fjx_work_thread *try_get_idle_thread_unsafe(fjx_fiber_scheduler *);
DLL_LOCAL void enqueue_fiber(fjx_fiber_scheduler *, fjx_fiber *);
DLL_LOCAL void enqueue_fiber_list(fjx_fiber_scheduler *, fjx_list *);
Expand Down
4 changes: 2 additions & 2 deletions src/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ int fiber_channel_send(
fjx_list_add_tail(&ch->witem_list, &src.link);

fjx_spinlock_lock(&sched->queue_lock);
src.fiber.stack_top = get_avaiable_fiber_unsafe(sched)->stack_top;
src.fiber.stack_top = get_available_fiber_unsafe(sched)->stack_top;
fjx_spinlock_unlock(&sched->queue_lock);
fiber_insert_cleanup(&src.fiber, (cleanup_func_t)fjx_spinlock_unlock, &ch->lock);
fiber_switch(&src.fiber);
Expand Down Expand Up @@ -94,7 +94,7 @@ int fiber_channel_receive(
fjx_list_add_tail(&ch->ritem_list, &dest.link);

fjx_spinlock_lock(&sched->queue_lock);
dest.fiber.stack_top = get_avaiable_fiber_unsafe(sched)->stack_top;
dest.fiber.stack_top = get_available_fiber_unsafe(sched)->stack_top;
fjx_spinlock_unlock(&sched->queue_lock);
fiber_insert_cleanup(&dest.fiber, (cleanup_func_t)fjx_spinlock_unlock, &ch->lock);
fiber_switch(&dest.fiber);
Expand Down
6 changes: 3 additions & 3 deletions src/fiber.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void fiber_yield(fjx_fiber_scheduler *sched) {
fjx_fiber f;

fjx_spinlock_lock(&sched->queue_lock);
f.stack_top = get_avaiable_fiber_unsafe(sched)->stack_top;
f.stack_top = get_available_fiber_unsafe(sched)->stack_top;
fjx_list_add_tail(&sched->fiber_list, &f.link);
fiber_insert_cleanup(&f, (cleanup_func_t)fjx_spinlock_unlock, &sched->queue_lock);
fiber_switch(&f);
Expand All @@ -37,7 +37,7 @@ void fiber_exit(fjx_fiber_scheduler *sched) {
fjx_fiber f;

fjx_spinlock_lock(&sched->queue_lock);
f.stack_top = get_avaiable_fiber_unsafe(sched)->stack_top;
f.stack_top = get_available_fiber_unsafe(sched)->stack_top;
fjx_spinlock_unlock(&sched->queue_lock);

fjx_spinlock_lock(&sched->disposed_fiber_lock);
Expand All @@ -58,7 +58,7 @@ void *fiber_spawn_stack_top(
fjx_fiber_scheduler *sched,
entrance_func_t entrance,
void *data) {
fjx_fiber_memory *mem = get_avaiable_memory(sched);
fjx_fiber_memory *mem = get_available_memory(sched);
void **stack_ptr = (void **)align_address(((char *)mem->addr) + mem->size);
*(stack_ptr - 1) = sched;
*(stack_ptr - 2) = (void *)fiber_exit;
Expand Down
2 changes: 1 addition & 1 deletion src/mutex.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void fiber_mutex_lock(
fjx_list_add_tail(&m->fiber_list, &f.link);

fjx_spinlock_lock(&sched->queue_lock);
f.stack_top = get_avaiable_fiber_unsafe(sched)->stack_top;
f.stack_top = get_available_fiber_unsafe(sched)->stack_top;
fjx_spinlock_unlock(&sched->queue_lock);

fiber_insert_cleanup(&f, (cleanup_func_t)fjx_spinlock_unlock, &m->lock);
Expand Down
4 changes: 2 additions & 2 deletions src/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void fiber_scheduler_destroy(
free(sched);
}

fjx_fiber *get_avaiable_fiber_unsafe(
fjx_fiber *get_available_fiber_unsafe(
fjx_fiber_scheduler *sched) {
if (fjx_list_empty(&sched->fiber_list)) {
return &current_work_thread(sched)->thread_fiber;
Expand Down Expand Up @@ -104,7 +104,7 @@ static inline void insert_memory(
fjx_rwlock_unlockw(&sched->pool_lock);
}

fjx_fiber_memory *get_avaiable_memory(
fjx_fiber_memory *get_available_memory(
fjx_fiber_scheduler *sched) {
fjx_spinlock_lock(&sched->disposed_fiber_lock);

Expand Down
2 changes: 1 addition & 1 deletion src/semaphore.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void fiber_semaphore_wait(
fjx_list_add_tail(&s->fiber_list, &f.link);

fjx_spinlock_lock(&sched->queue_lock);
f.stack_top = get_avaiable_fiber_unsafe(sched)->stack_top;
f.stack_top = get_available_fiber_unsafe(sched)->stack_top;
fjx_spinlock_unlock(&sched->queue_lock);

fiber_insert_cleanup(&f, (cleanup_func_t)fjx_spinlock_unlock, &s->lock);
Expand Down

0 comments on commit cf73f14

Please sign in to comment.