Home Help Center

Question about thread

I want to build a DLL and then any application can invoke the APIs in the dll. Now My question is how can I implement a thread in which one Api would to be called every minute in the DLL.the API is invoke one methos in the server.


Help me!

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Assuming you use the IceUtil thread class (see the "Threads and Concurrency with C++" chapter in the Ice book) , it's very simple. Your run function could do something like:

    IceUtil::Mutex::Lock lock(_mutex);
    while(!_done)
    {
    callMyAPI();

    _condVar.timedWait(lock, IceUtil::Time::seconds(60));
    }

    Cheers,
    Bernard
Sign In or Register to comment.