I would like to use threads in a switch. Is this possible or is there another way to interrupt the thread elsewhere in the program? 

```
switch (event_element)    // dispatch event handler
{
    case 1: // main task thread
    {
        boost::thread thr_check_db_task (check_db_task);
        break;
    }
    case 2:
    {
        std::cerr << "DATABASE CONNECTION ERROR" << std::endl;
        thr_check_db_task.interrupt ();        // **COMPILE ERROR**
        mysql_connection_error ();
        break;
    }
    default:
        break;
}

```

Thank you.