Compartilhar via


Shared Thread Pool (Windows CE 5.0)

Send Feedback

Only the HCI layer maintains two persistent threads; write and read. Other layers borrow threads from the top or bottom layers of the stack as they are called with commands and events.

To increase the efficiency and facilitate shutdown logic, thread layers are discouraged from maintaining their own thread pools as well as creating new threads using the CreateThread mechanism.

The Bluetooth stack provides a shared thread pool accessible through the following set of functions.

SVSCookie btutil_ScheduleEvent (
    LPTHREAD_START_ROUTINE pfn,
    LPVOID lpParameter,
    unsigned long ulDelayTime
);
int btutil_UnScheduleEvent (SVSCookie ulCookie);

By using these functions, stack layers are guaranteed the threads will be properly stopped before the stack is unloaded.

See Also

Common Layer Characteristics | Bluetooth Protocol Stack

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.