ext/oxt/dynamic_thread_group.hpp in passenger-3.9.2.beta vs ext/oxt/dynamic_thread_group.hpp in passenger-4.0.0.rc4

- old
+ new

@@ -1,10 +1,10 @@ /* * OXT - OS eXtensions for boosT * Provides important functionality necessary for writing robust server software. * - * Copyright (c) 2010 Phusion + * Copyright (c) 2010-2013 Phusion * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell @@ -142,9 +142,17 @@ ); nthreads++; } catch (...) { thread_handles.erase(handle->iterator); throw; + } + } + + void interrupt_all() { + boost::unique_lock<boost::mutex> l(lock); + list<thread_handle_ptr>::iterator it; + for (it = thread_handles.begin(); it != thread_handles.end(); it++) { + (*it)->thr->interrupt(); } } /** * Interrupt and join all threads in this group.