1 // **********************************************************************
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
8 // **********************************************************************
11 # include <IceUtil/Config.h>
13 #include <ThreadNotification.h>
16 using namespace IcePy
;
18 IcePy::ThreadNotificationWrapper::ThreadNotificationWrapper(PyObject
* threadNotification
) :
19 _threadNotification(threadNotification
)
21 Py_INCREF(threadNotification
);
25 IcePy::ThreadNotificationWrapper::start()
27 AdoptThread adoptThread
; // Ensure the current thread is able to call into Python.
29 PyObjectHandle tmp
= PyObject_CallMethod(_threadNotification
.get(), STRCAST("start"), 0);
32 throwPythonException();
37 IcePy::ThreadNotificationWrapper::stop()
39 AdoptThread adoptThread
; // Ensure the current thread is able to call into Python.
41 PyObjectHandle tmp
= PyObject_CallMethod(_threadNotification
.get(), STRCAST("stop"), 0);
44 throwPythonException();
49 IcePy::ThreadNotificationWrapper::getObject()
51 return _threadNotification
.get();