Esempio n. 1
0
/** Terminates the WWD Thread
 *
 * Sets a flag then wakes the WWD Thread to force it to terminate.
 *
 */
void wwd_thread_quit( void )
{
    wwd_result_t result;

    /* signal main thread and wake it */
    wwd_thread_quit_flag = WICED_TRUE;
    result = host_rtos_set_semaphore( &wwd_transceive_semaphore, WICED_FALSE );

    if ( result == WWD_SUCCESS )
    {
        /* Wait for the WWD thread to end */
        host_rtos_join_thread( &wwd_thread );

        (void) host_rtos_delete_terminated_thread( &wwd_thread ); /* Ignore return - not much can be done about failure */
    }
}
Esempio n. 2
0
besl_result_t besl_p2p_deinit( p2p_workspace_t* workspace )
{
    /* Stop and delete the P2P thread */
    besl_p2p_stop(workspace);
    host_rtos_join_thread(&p2p_thread);
    host_rtos_delete_terminated_thread(&p2p_thread);
    memset(&p2p_thread, 0, sizeof(p2p_thread));

    /* Delete the message queue */
    host_rtos_deinit_queue( &p2p_message_queue );

    /* Delete the pending outgoing packet queue */
    host_rtos_deinit_queue( &p2p_outgoing_packet_queue );

    return BESL_SUCCESS;
}
wiced_result_t wiced_rtos_thread_join( wiced_thread_t* thread )
{
    return host_rtos_join_thread( WICED_GET_THREAD_HANDLE( thread ) );
}