mco_async_event_release_all

Unblock all the threads that are waiting on all events for the specified database.

Prototype

            MCO_RET	mco_async_event_release_all(	/*IN*/ mco_db_h db );

Arguments

db
The database handle that was established by mco_db_connect().

Description

This function unblocks all the threads that are waiting on all events for the specified database.

Return Codes

MCO_S_OK
Events were released successfully.
MCO_E_INVALID_HANDLE
The database handle is invalid.
MCO_S_EVENT_RELEASED
Events were already released.

Example

            const char * dbname = "SimpleDb";

            MCO_RET Event_NewHndlr( sample_task_t * descriptor )
            {
                int count = 0;

                /* use the connection created by sample_start_connected_task() */
                mco_db_h db = descriptor->db_connection;
                while ( MCO_S_OK == mco_async_event_wait(db, MCO_EVENT_newEvent) )
                {
                    printf("\tNewEventHandler call %d\n", count);
                    count++;
                }
                printf("\tExiting NewEventHandler. Number of calls : %d\n", count);
            }

            int main(int argc, char* argv[])
            {
                mco_db_h db;
                MCO_RET rc;
                mco_device_t       dev;
                mco_db_params_t    db_params;
                mco_trans_h t;
                ...
                rc = mco_db_open_dev( dbname, simple_get_dictionary(), &dev, 1, &db_params );
                if ( MCO_S_OK != rc )
                {
                    rc = mco_db_connect(  dbname, &db );
                    ...
                        ...
                        _beginthread( Event_NewHndlr, 0, (void*)db );
                        Sleep(100);
                        ...
                        rc = mco_async_event_release_all( db );
                        ...
                }
                ...
            }

Files

Header file:
mco.h
Source file:
mcoevasy.c
Library:
libmcolib.a