Exemple #1
0
/** Delete a semaphore
 * @param sem semaphore to delete */
void sys_sem_free(sys_sem_t *sem)
{
	if (sys_sem_valid(sem)) {
		SYS_STATS_DEC(sem.used);
		vSemaphoreDelete(*sem);
	}
}
Exemple #2
0
/** Delete a semaphore
 * @param mutex the mutex to delete */
void sys_mutex_free(sys_mutex_t *mutex)
{
	if (sys_mutex_valid(mutex)) {
		SYS_STATS_DEC(mutex.used);
		vSemaphoreDelete(*mutex);
	}
}
Exemple #3
0
/*-----------------------------------------------------------------------------------*/
void
sys_sem_free(struct sys_sem **sem)
{
  if ((sem != NULL) && (*sem != SYS_SEM_NULL)) {
    SYS_STATS_DEC(sem.used);
    sys_sem_free_internal(*sem);
  }
}
Exemple #4
0
void sys_mbox_free(sys_mbox_t *mb)
{
  if ((mb != NULL) && (*mb != NULL)) {

    sys_mbox_t mbox = *mb;

    uosRingDestroy(mbox);
    SYS_STATS_DEC(mbox.used);
  }
}
Exemple #5
0
void sys_mbox_free(struct sys_mbox** mbox) {
	if(unlikely(!(*mbox)))
		return;

	SYS_STATS_DEC(mbox.used);

	kfree((*mbox)->msg);
	kfree((*mbox));

	(*mbox) = NULL;
}
Exemple #6
0
void sys_mbox_free(sys_mbox_t *mbox) {

  if (chMBGetUsedCountI(*mbox) != 0) {
    // If there are messages still present in the mailbox when the mailbox
    // is deallocated, it is an indication of a programming error in lwIP
    // and the developer should be notified.
    SYS_STATS_INC(mbox.err);
    chMBReset(*mbox);
  }
  chHeapFree(*mbox);
  *mbox = SYS_MBOX_NULL;
  SYS_STATS_DEC(mbox.used);
}
Exemple #7
0
void sys_sem_free(sys_sem_t *sem)
{
  /* parameter check */
  LWIP_ASSERT("sem != NULL", sem != NULL);
  LWIP_ASSERT("sem->sem != SYS_SEM_NULL", sem->sem != SYS_SEM_NULL);
  LWIP_ASSERT("sem->sem != INVALID_HANDLE_VALUE", sem->sem != INVALID_HANDLE_VALUE);
  CloseHandle(sem->sem);

  SYS_STATS_DEC(sem.used);
#if LWIP_STATS && SYS_STATS
  LWIP_ASSERT("sys_sem_free() closed more than created", lwip_stats.sys.sem.used != (u16_t)-1);
#endif /* LWIP_STATS && SYS_STATS */
  sem->sem = NULL;
}
Exemple #8
0
void sys_mbox_free(sys_mbox_t *mbox)
{
  /* parameter check */
  LWIP_ASSERT("mbox != NULL", mbox != NULL);
  LWIP_ASSERT("mbox->sem != NULL", mbox->sem != NULL);
  LWIP_ASSERT("mbox->sem != INVALID_HANDLE_VALUE", mbox->sem != INVALID_HANDLE_VALUE);

  CloseHandle(mbox->sem);

   SYS_STATS_DEC(mbox.used);
#if LWIP_STATS && SYS_STATS
   LWIP_ASSERT( "sys_mbox_free() ", lwip_stats.sys.mbox.used!= (u16_t)-1 );
#endif /* LWIP_STATS && SYS_STATS */
  mbox->sem = NULL;
}
Exemple #9
0
/*---------------------------------------------------------------------------*
 * Routine:  sys_mbox_free
 *---------------------------------------------------------------------------*
 * Description:
 *      Deallocates a mailbox. If there are messages still present in the
 *      mailbox when the mailbox is deallocated, it is an indication of a
 *      programming error in lwIP and the developer should be notified.
 * Inputs:
 *      sys_mbox_t mbox         -- Handle of mailbox
 * Outputs:
 *      sys_mbox_t              -- Handle to new mailbox
 *---------------------------------------------------------------------------*/
void sys_mbox_free(sys_mbox_t *mbox)
{
    UBaseType_t msgs_waiting;

    msgs_waiting = uxQueueMessagesWaiting(*mbox);
    configASSERT(msgs_waiting == 0);

#if SYS_STATS
    if (msgs_waiting != 0) {
        SYS_STATS_INC(mbox.err);
    }
    SYS_STATS_DEC(mbox.used);
#endif /* SYS_STATS */

    vQueueDelete(*mbox);
}
Exemple #10
0
/*-----------------------------------------------------------------------------------*/
void
sys_mbox_free(struct sys_mbox **mb)
{
  if ((mb != NULL) && (*mb != SYS_MBOX_NULL)) {
    struct sys_mbox *mbox = *mb;
    SYS_STATS_DEC(mbox.used);
    sys_arch_sem_wait(&mbox->mutex, 0);

    sys_sem_free_internal(mbox->not_empty);
    sys_sem_free_internal(mbox->not_full);
    sys_sem_free_internal(mbox->mutex);
    mbox->not_empty = mbox->not_full = mbox->mutex = NULL;
    /*  LWIP_DEBUGF("sys_mbox_free: mbox 0x%lx\n", mbox); */
    free(mbox);
  }
}
Exemple #11
0
/*---------------------------------------------------------------------------*
 * Routine:  sys_mbox_free
 *---------------------------------------------------------------------------*
 * Description:
 *      Deallocates a mailbox. If there are messages still present in the
 *      mailbox when the mailbox is deallocated, it is an indication of a
 *      programming error in lwIP and the developer should be notified.
 * Inputs:
 *      sys_mbox_t mbox         -- Handle of mailbox
 * Outputs:
 *      sys_mbox_t              -- Handle to new mailbox
 *---------------------------------------------------------------------------*/
void sys_mbox_free( sys_mbox_t *pxMailBox ) {
	BT_u32 ulMessagesWaiting;

	ulMessagesWaiting = BT_QueueMessagesWaiting( *pxMailBox );

	#if SYS_STATS
	{
		if( ulMessagesWaiting != 0UL ) {
			SYS_STATS_INC( mbox.err );
		}

		SYS_STATS_DEC( mbox.used );
	}
	#endif /* SYS_STATS */

	BT_CloseHandle( *pxMailBox );
}
Exemple #12
0
/** Delete an mbox
 * @param mbox mbox to delete */
void sys_mbox_free(sys_mbox_t *mbox)
{
	u32_t msg_wait_cnt = 0;

	if (!sys_mbox_valid(mbox)) {
		return;
	}
	msg_wait_cnt = uxQueueMessagesWaiting(*mbox);

	if (msg_wait_cnt) {
  		LWIP_DEBUGF(SYS_DEBUG, ("sys_mbox_free: mbox 0x%x, %d msgs waited\n", (uint32_t)(*mbox), msg_wait_cnt));
  		SYS_STATS_INC(mbox.err);
	}
	SYS_STATS_DEC(mbox.used);

	vQueueDelete( *mbox );
}
Exemple #13
0
/*---------------------------------------------------------------------------*
 * Routine:  sys_mbox_free
 *---------------------------------------------------------------------------*
 * Description:
 *      Deallocates a mailbox. If there are messages still present in the
 *      mailbox when the mailbox is deallocated, it is an indication of a
 *      programming error in lwIP and the developer should be notified.
 * Inputs:
 *      sys_mbox_t mbox         -- Handle of mailbox
 * Outputs:
 *      sys_mbox_t              -- Handle to new mailbox
 *---------------------------------------------------------------------------*/
void sys_mbox_free( sys_mbox_t *pxMailBox )
{
unsigned long ulMessagesWaiting;

	ulMessagesWaiting = uxQueueMessagesWaiting( *pxMailBox );
	configASSERT( ( ulMessagesWaiting == 0 ) );

	#if SYS_STATS
	{
		if( ulMessagesWaiting != 0UL )
		{
			SYS_STATS_INC( mbox.err );
		}

		SYS_STATS_DEC( mbox.used );
	}
	#endif /* SYS_STATS */

	vQueueDelete( *pxMailBox );
}
Exemple #14
0
/** Delete a semaphore
 * @param mutex the mutex to delete */
void sys_mutex_free( sys_mutex_t *Mutex ) {
	SYS_STATS_DEC( mutex.used );
	BT_CloseHandle( *Mutex );
}
Exemple #15
0
/** Delete a semaphore
 * @param mutex the mutex to delete */
void sys_mutex_free(sys_mutex_t *pxMutex)
{
    SYS_STATS_DEC(mutex.used);
    vSemaphoreDelete(*pxMutex);
    *pxMutex = NULL;
}
Exemple #16
0
void sys_sem_free(sys_sem_t *sem) {

  chHeapFree(*sem);
  *sem = SYS_SEM_NULL;
  SYS_STATS_DEC(sem.used);
}
Exemple #17
0
/*---------------------------------------------------------------------------*
 * Routine:  sys_sem_free
 *---------------------------------------------------------------------------*
 * Description:
 *      Deallocates a semaphore
 * Inputs:
 *      sys_sem_t sem           -- Semaphore to free
 *---------------------------------------------------------------------------*/
void sys_sem_free( sys_sem_t *pxSemaphore )
{
	SYS_STATS_DEC(sem.used);
	vQueueDelete( *pxSemaphore );
}
Exemple #18
0
/** Delete a semaphore
 * @param mutex the mutex to delete */
void sys_mutex_free( sys_mutex_t *pxMutex )
{
	SYS_STATS_DEC( mutex.used );
	vQueueDelete( *pxMutex );
}
Exemple #19
0
/*---------------------------------------------------------------------------*
 * Routine:  sys_sem_free
 *---------------------------------------------------------------------------*
 * Description:
 *      Deallocates a semaphore
 * Inputs:
 *      sys_sem_t sem           -- Semaphore to free
 *---------------------------------------------------------------------------*/
void sys_sem_free(sys_sem_t *pxSemaphore)
{
    SYS_STATS_DEC(sem.used);
    vSemaphoreDelete(*pxSemaphore);
    *pxSemaphore = NULL;
}
Exemple #20
0
void sys_sem_free(struct sys_sem** sem) {
	SYS_STATS_DEC(sem.used);

	kfree(*sem);
	(*sem) = NULL;
}
Exemple #21
0
/*---------------------------------------------------------------------------*
 * Routine:  sys_sem_free
 *---------------------------------------------------------------------------*
 * Description:
 *      Deallocates a semaphore
 * Inputs:
 *      sys_sem_t sem           -- Semaphore to free
 *---------------------------------------------------------------------------*/
void sys_sem_free( sys_sem_t *pxSemaphore ) {
	SYS_STATS_DEC(sem.used);
	BT_CloseHandle( *pxSemaphore );
}