added some semaphore handling code

This commit is contained in:
2021-02-05 15:22:39 +00:00
parent 9c2f757e16
commit ac58758da0
3 changed files with 159 additions and 81 deletions

View File

@ -842,10 +842,20 @@ static pf_t builtin_prims[] =
{ 1, 1, hcl_pf_process_fork, 4, { 'f','o','r','k'} },
{ 1, 1, hcl_pf_process_resume, 6, { 'r','e','s','u','m','e' } },
{ 0, 1, hcl_pf_process_suspend, 7, { 's','u','s','p','e','n','d' } },
{ 0, 0, hcl_pf_process_yield, 5, { 'y','i','e','l','d'} }
};
{ 0, 0, hcl_pf_process_yield, 5, { 'y','i','e','l','d'} },
{ 0, 0, hcl_pf_semaphore_new, 7, { 's','e','m','-','n','e','w'} },
{ 1, 1, hcl_pf_semaphore_wait, 8, { 's','e','m','-','w','a','i','t'} },
{ 1, 3, hcl_pf_semaphore_signal, 10, { 's','e','m','-','s','i','g','n','a','l'} },
{ 1, 1, hcl_pf_semaphore_unsignal, 12, { 's','e','m','-','u','n','s','i','g','n','a','l'} },
{ 0, 0, hcl_pf_semaphore_group_new, 9, { 's','e','m','g','r','-','n','e','w'} },
{ 1, 2, hcl_pf_semaphore_group_add_semaphore, 9, { 's','e','m','g','r','-','a','d','d'} },
{ 1, 2, hcl_pf_semaphore_group_remove_semaphore, 12, { 's','e','m','g','r','-','r','e','m','o','v','e'} },
{ 1, 1, hcl_pf_semaphore_group_wait, 10, { 's','e','m','g','r','-','w','a','i','t'} }
};
int hcl_addbuiltinprims (hcl_t* hcl)
{
hcl_oow_t i;