mirror of
https://github.com/pocoproject/poco.git
synced 2025-05-02 15:41:36 +02:00
updated NotificationQueue sample
This commit is contained in:
parent
9cb9229a4e
commit
e1cda6be1c
@ -1,7 +1,7 @@
|
||||
//
|
||||
// NotificationQueue.cpp
|
||||
//
|
||||
// $Id: //poco/svn/Foundation/samples/NotificationQueue/src/NotificationQueue.cpp#1 $
|
||||
// $Id: //poco/Main/Foundation/samples/NotificationQueue/src/NotificationQueue.cpp#12 $
|
||||
//
|
||||
// This sample demonstrates the NotificationQueue, ThreadPool,
|
||||
// FastMutex and ScopedLock classes.
|
||||
@ -58,6 +58,8 @@ class WorkNotification: public Notification
|
||||
// The notification sent to worker threads.
|
||||
{
|
||||
public:
|
||||
typedef AutoPtr<WorkNotification> Ptr;
|
||||
|
||||
WorkNotification(int data):
|
||||
_data(data)
|
||||
{
|
||||
@ -89,10 +91,10 @@ public:
|
||||
Random rnd;
|
||||
for (;;)
|
||||
{
|
||||
AutoPtr<Notification> pNf(_queue.waitDequeueNotification());
|
||||
Notification::Ptr pNf(_queue.waitDequeueNotification());
|
||||
if (pNf)
|
||||
{
|
||||
WorkNotification* pWorkNf = dynamic_cast<WorkNotification*>(pNf.get());
|
||||
WorkNotification::Ptr pWorkNf = pNf.cast<WorkNotification>();
|
||||
if (pWorkNf)
|
||||
{
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user