AzureMXChip/MXCHIPAZ3166/core/lib/threadx/ports/xtensa/xcc/src/tx_clib_lock.c
void
_tx_clib_reent_cleanup (TX_THREAD * thread_ptr, int32_t partial)
{
#if XSHAL_CLIB == XTHAL_CLIB_NEWLIB
    struct _reent * reent = &(thread_ptr->tx_thread_clib_reent);
    FILE * fp = &(reent->__sf[0]);
    int32_t i;

  /* Avoid closing stdin,stdout,stderr so other threads can still use them. */
    for (i = 0; i < 3; i++) {
        fp->_close = NULL;
        fp++;
    }

    if (partial != 0) {
        /* Perform "atexit" processing and clean up stdio. */
        _wrapup_reent (reent);
    }
    else {
        /* Free all the heap memory allocated in the reent structure.
           ThreadX requires that the thread has either exited or been
           terminated before it can be deleted so we can assume that
           _wrapup_reent has already been called for this thread. */
        _reclaim_reent (reent);
    }
#endif

#if XSHAL_CLIB == XTHAL_CLIB_XCLIB
  /* Unused, keep compiler happy */
  (void) partial;

  /* File handle table is global; no allocated memory in struct. */
  thread_ptr->tx_thread_clib_ptr = 0;
#endif
}
/**************************************************************************/
/*    _tx_clib_reent_cleanup - clean up C library thread reent structure. */
/*    Called by tx_thread_delete() to clean up per-thread C library state */
/*    and free any allocated memory (partial = 0).                        */
/*    Called by tx_thread_shell_entry and tx_thread_terminate to perform  */
/*    "atexit" processing and clean up stdio, but leaving the rest of the */
/*    structure intact so the thread can be restarted (partial = 1).      */
/**************************************************************************/
clean up C library thread reent structure.
Called by tx_thread_delete() to clean up per-thread C library state
and free any allocated memory (partial = 0).
Called by tx_thread_shell_entry and tx_thread_terminate to perform
"atexit" processing and clean up stdio, but leaving the rest of the
structure intact so the thread can be restarted (partial = 1).
clean up C library thread reent structure . Called by tx_thread_delete () to clean up per - thread C library state and free any allocated memory ( partial = 0 ) . Called by tx_thread_shell_entry and tx_thread_terminate to perform " atexit " processing and clean up stdio but leaving the rest of the structure intact so the thread can be restarted ( partial = 1 ) .
void
_tx_clib_reent_cleanup (TX_THREAD * thread_ptr, int32_t partial)
{
#if XSHAL_CLIB == XTHAL_CLIB_NEWLIB
    struct _reent * reent = &(thread_ptr->tx_thread_clib_reent);
    FILE * fp = &(reent->__sf[0]);
    int32_t i;
    for (i = 0; i < 3; i++) {
        fp->_close = NULL;
        fp++;
    }
    if (partial != 0) {
        _wrapup_reent (reent);
    }
    else {
        _reclaim_reent (reent);
    }
#endif
#if XSHAL_CLIB == XTHAL_CLIB_XCLIB
  (void) partial;
  thread_ptr->tx_thread_clib_ptr = 0;
#endif
}
void _tx_clib_reent_cleanup ( TX_THREAD * thread_ptr , int32_t partial ) { #if XSHAL_CLIB == XTHAL_CLIB_NEWLIB struct _reent * reent = & ( thread_ptr -> tx_thread_clib_reent ) ; FILE * fp = & ( reent -> __sf [ 0 ] ) ; int32_t i ; for ( i = 0 ; i < 3 ; i ++ ) { fp -> _close = NULL ; fp ++ ; } if ( partial != 0 ) { _wrapup_reent ( reent ) ; } else { _reclaim_reent ( reent ) ; } #endif #if XSHAL_CLIB == XTHAL_CLIB_XCLIB ( void ) partial ; thread_ptr -> tx_thread_clib_ptr = 0 ; #endif }
_tx_clib_reent_cleanup - clean up C library thread reent structure.
_tx_clib_reent_cleanup - clean up C library thread reent structure .
/* Avoid closing stdin,stdout,stderr so other threads can still use them. */ /* Perform "atexit" processing and clean up stdio. */ /* Free all the heap memory allocated in the reent structure.
           ThreadX requires that the thread has either exited or been
           terminated before it can be deleted so we can assume that
           _wrapup_reent has already been called for this thread. */ /* Unused, keep compiler happy */ /* File handle table is global; no allocated memory in struct. */