Make wxThread::OnExit() protected rather than private
This allows calling the base class version from the derived classes and also, at least as importantly, make sure that the function is actually documented as private functions are not extracted by Doxygen by default. Closes #16749. Closes https://github.com/wxWidgets/wxWidgets/pull/1543
This commit is contained in:
@@ -622,16 +622,16 @@ protected:
|
|||||||
// in the context of the thread that called Kill().
|
// in the context of the thread that called Kill().
|
||||||
virtual void OnKill() {}
|
virtual void OnKill() {}
|
||||||
|
|
||||||
|
// called when the thread exits - in the context of this thread
|
||||||
|
//
|
||||||
|
// NB: this function will not be called if the thread is Kill()ed
|
||||||
|
virtual void OnExit() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// no copy ctor/assignment operator
|
// no copy ctor/assignment operator
|
||||||
wxThread(const wxThread&);
|
wxThread(const wxThread&);
|
||||||
wxThread& operator=(const wxThread&);
|
wxThread& operator=(const wxThread&);
|
||||||
|
|
||||||
// called when the thread exits - in the context of this thread
|
|
||||||
//
|
|
||||||
// NB: this function will not be called if the thread is Kill()ed
|
|
||||||
virtual void OnExit() { }
|
|
||||||
|
|
||||||
friend class wxThreadInternal;
|
friend class wxThreadInternal;
|
||||||
friend class wxThreadModule;
|
friend class wxThreadModule;
|
||||||
|
|
||||||
|
@@ -489,7 +489,7 @@ public:
|
|||||||
|
|
||||||
@since 2.9.2
|
@since 2.9.2
|
||||||
|
|
||||||
@see OnKill()
|
@see OnKill(), OnExit()
|
||||||
*/
|
*/
|
||||||
virtual void OnDelete();
|
virtual void OnDelete();
|
||||||
|
|
||||||
@@ -503,10 +503,25 @@ public:
|
|||||||
|
|
||||||
@since 2.9.2
|
@since 2.9.2
|
||||||
|
|
||||||
@see OnDelete()
|
@see OnDelete(), OnExit()
|
||||||
*/
|
*/
|
||||||
virtual void OnKill();
|
virtual void OnKill();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Callback called by Exit() before actually exiting the thread.
|
||||||
|
This function will not be called if the thread was @ref Kill() killed.
|
||||||
|
|
||||||
|
This function can be overridden by the derived class to perform some
|
||||||
|
specific task when the thread is exited. The base class version does
|
||||||
|
nothing and doesn't need to be called if this method is overridden.
|
||||||
|
|
||||||
|
Note that this function is protected since wxWidgets 3.1.1,
|
||||||
|
but previously existed as a private method since 2.9.2.
|
||||||
|
|
||||||
|
@see OnDelete(), OnKill()
|
||||||
|
*/
|
||||||
|
virtual void OnExit();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@deprecated
|
@deprecated
|
||||||
Use CreateThread() instead.
|
Use CreateThread() instead.
|
||||||
@@ -1371,19 +1386,6 @@ protected:
|
|||||||
OnExit() will be called just before exiting.
|
OnExit() will be called just before exiting.
|
||||||
*/
|
*/
|
||||||
void Exit(ExitCode exitcode = 0);
|
void Exit(ExitCode exitcode = 0);
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
/**
|
|
||||||
Called when the thread exits.
|
|
||||||
|
|
||||||
This function is called in the context of the thread associated with the
|
|
||||||
wxThread object, not in the context of the main thread.
|
|
||||||
This function will not be called if the thread was @ref Kill() killed.
|
|
||||||
|
|
||||||
This function should never be called directly.
|
|
||||||
*/
|
|
||||||
virtual void OnExit();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user