?????????get???????????????????????е???????????????????????????????????????????????о???????????????????ò????????????????????????????ok?????????????????????????????????????????????????????????????????

static RAW_U16 internal_semaphore_put(RAW_SEMAPHORE *semaphore_ptr?? RAW_U8 opt_wake_all)
{
 LIST *block_list_head;
 
 RAW_SR_ALLOC();

 #if (RAW_SEMA_FUNCTION_CHECK > 0)
 
 if (semaphore_ptr == 0) {
  
  return RAW_NULL_OBJECT;
 }
 
 #endif

 block_list_head = &semaphore_ptr->common_block_obj.block_list;
 
 RAW_CRITICAL_ENTER();
 /*if no block task on this list just return*/
 if (is_list_empty(block_list_head)) {       
    
  if (semaphore_ptr->count == 0xffffffff) {

   RAW_CRITICAL_EXIT();
   return RAW_SEMOPHORE_OVERFLOW;

  }
  /*increase resource*/
     semaphore_ptr->count++;                                     
    
     RAW_CRITICAL_EXIT();
     return RAW_SUCCESS;
 }

 /*wake all the task blocked on this semphore*/
 if (opt_wake_all) {

  while (!is_list_empty(block_list_head)) {
   raw_wake_object(list_entry(block_list_head->next?? RAW_TASK_OBJ?? task_list));
  }

 }

 else {
  
  /*Wake up the highest priority task block on the semaphore*/
  raw_wake_object(list_entry(block_list_head->next?? RAW_TASK_OBJ?? task_list));
 }
 
 RAW_CRITICAL_EXIT();

 raw_sched();   

 return RAW_SUCCESS;
}

?????????????????????????????????????????????????????????????????????????£?

??????1???ж???????????

??????2???ж???????е?????У??????У???count?????????????????????count????0xffffffff???????????????????

??????3?? ????????????У?????opt_wake_all?????????????????????????е?????

??????4????????????????????????????????????е????

??????5??????????ε?????е?????????????