Skip to content

Commit 3f71fcc

Browse files
Merge branch 'iss-25' into develop
2 parents 1478610 + 9a5af0f commit 3f71fcc

File tree

5 files changed

+36
-22
lines changed

5 files changed

+36
-22
lines changed

include/pthread/condition_variable.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,13 @@ namespace pthread {
178178
*/
179179
class condition_variable_exception: public pthread_exception {
180180
public:
181-
condition_variable_exception( const string message, const int pthread_error = 0);
181+
182+
/** thrown when mutex actions fail
183+
*
184+
* @param message short description
185+
* @param pthread_errno error returned by the pthread function
186+
*/
187+
condition_variable_exception( const string message, const int pthread_errno = 0);
182188
virtual ~condition_variable_exception(){};
183189
};
184190

include/pthread/mutex.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,21 @@ namespace pthread {
6767
virtual ~mutex ();
6868

6969
protected:
70-
pthread_mutex_t _mutex;
70+
/** pthread mutex structure */
71+
pthread_mutex_t _mutex;
7172
};
7273

7374
/** throw to indicate that something went wrong with a mutex.
7475
*/
7576
class mutex_exception: public pthread_exception {
7677
public:
78+
7779
/** thrown when mutex actions fail
7880
*
7981
* @param message short description
8082
* @param pthread_errno error returned by the pthread function
8183
*/
82-
mutex_exception( const string message, const int pthread_error = 0) ;
84+
mutex_exception( const string message, const int pthread_errno = 0) ;
8385

8486
};
8587

include/pthread/pthread.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*/
3232
namespace pthread {
3333

34+
/** @return library version */
3435
extern "C" const char *cpp_pthread_version();
3536

3637
}

include/pthread/pthread_exception.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace pthread {
2727
* @param message error message
2828
* @param pthread_errno a pthread function return code.
2929
*/
30-
pthread_exception( const string message, const int pthread_number = 0 ): _message(message), _pthread_errno(pthread_number){};
30+
pthread_exception( const string message, const int pthread_errno = 0 ): _message(message), _pthread_errno(pthread_number){};
3131

3232
virtual ~pthread_exception(){};
3333

@@ -50,7 +50,10 @@ namespace pthread {
5050
*/
5151
class timeout_exception: public pthread_exception{
5252
public:
53-
/** thrown when a time out occurs. */
53+
/** thrown when a time out occurs.
54+
*
55+
* @param message timeout condition
56+
*/
5457
timeout_exception(const string message): pthread_exception(message, ETIMEDOUT){};
5558
};
5659

include/pthread/thread.hpp

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ namespace pthread {
8383

8484
// /** Starts running given function in a new trhread.
8585
// *
86-
// * @param f function to run in thread
87-
// * @param args function paramleters/arguments.
86+
// * param f function to run in thread
87+
// * param args function paramleters/arguments.
8888
// */
8989
// template<class Function, class... Args> explicit thread(Function&& f, Args&&... args);
9090

@@ -272,7 +272,7 @@ namespace pthread {
272272
*/
273273
virtual ~thread_group();
274274

275-
/** @param add/register a thread to the group.
275+
/** @param thread add/register a thread to the group.
276276
*/
277277
void add(abstract_thread *thread);
278278

@@ -306,6 +306,22 @@ namespace pthread {
306306
thread_exception(const string message, const int pthread_error = 0);
307307
};
308308

309+
/** \namespace pthread::this_thread
310+
*
311+
* helper functions
312+
*/
313+
namespace this_thread{
314+
315+
/** let the current thread sleep for the given milliseconds.
316+
*
317+
* @param millis time to wait.
318+
*/
319+
void sleep(const int millis);
320+
321+
/** @return current thread id/reference */
322+
pthread_t get_id() ;
323+
}
324+
309325
// template implementations ------
310326

311327
// // GCC magic
@@ -401,20 +417,6 @@ namespace pthread {
401417
//
402418
// }
403419

404-
/** \namespace this_thread
405-
*
406-
* helper functions
407-
*/
408-
namespace this_thread{
409-
410-
/** let the current thread sleep for the given milliseconds.
411-
*
412-
* @param milis time to wait.
413-
*/
414-
void sleep(const int millis);
415-
416-
pthread_t get_id() ;
417-
}
418420

419421
} // namespace pthread
420422
#endif /* thread_hpp */

0 commit comments

Comments
 (0)