*
* @return thread object
*/
-
-class foo : public std::binary_function<threadobject*, int32_t, bool> {
-public:
- bool operator() (const threadobject* t, const int32_t index) const
- {
- return (t->index == index);
- }
-};
-
threadobject* ThreadList::get_thread_by_index(int32_t index)
{
lock();
- List<threadobject*>::iterator it = find_if(_active_thread_list.begin(), _active_thread_list.end(), std::bind2nd(foo(), index));
+ List<threadobject*>::iterator it = find_if(_active_thread_list.begin(), _active_thread_list.end(), std::bind2nd(comparator(), index));
// No thread found.
if (it == _active_thread_list.end()) {
static inline void add_to_free_thread_list(threadobject* t);
static inline void add_to_free_index_list(int32_t index);
+private:
+ // Comparator class.
+ class comparator : public std::binary_function<threadobject*, int32_t, bool> {
+ public:
+ bool operator() (const threadobject* t, const int32_t index) const
+ {
+ return (t->index == index);
+ }
+ };
+
public:
static inline void lock() { _mutex.lock(); }
static inline void unlock() { _mutex.unlock(); }