~ubuntu-branches/ubuntu/trusty/nordugrid-arc/trusty-proposed

« back to all changes in this revision

Viewing changes to src/hed/libs/common/Thread.h

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2013-11-29 13:39:10 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20131129133910-altaxrfowczzl2ev
Tags: 4.0.0-1
4.0.0 Release (Closes: #715131) (LP: #1049798)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
      \return true on success. */
38
38
  bool CreateThreadFunction(void (*func)(void*), void *arg, SimpleCounter* count = NULL);
39
39
 
 
40
  /** \cond Internal class used to map glib thread ids (pointer addresses) to
 
41
     an incremental counter, for easier debugging. */
 
42
  class ThreadId {
 
43
  private:
 
44
    Glib::Mutex mutex;
 
45
    std::map<unsigned long int, unsigned long int> thread_ids;
 
46
    unsigned long int thread_no;
 
47
    ThreadId();
 
48
   public:
 
49
    static ThreadId& getInstance();
 
50
    /// Called at beginning of ThreadArgument.thread() to add thread id to map
 
51
    void add();
 
52
    /// Called at end of ThreadArgument.thread() to remove thread id from map
 
53
    void remove();
 
54
    /// Called by logger to get id of current thread
 
55
    unsigned long int get();
 
56
  };
 
57
  /** \endcond */
 
58
 
40
59
  class ThreadData;
41
60
 
42
61
  /// Base class for per-thread object.