Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: src/Thread.h

Issue 29361582: Issue 4613 - fix leak of Thread (Closed)
Patch Set: Created Nov. 3, 2016, 10:58 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 Lock(Mutex& mutex); 49 Lock(Mutex& mutex);
50 ~Lock(); 50 ~Lock();
51 51
52 private: 52 private:
53 Mutex& mutex; 53 Mutex& mutex;
54 }; 54 };
55 55
56 class Thread 56 class Thread
57 { 57 {
58 public: 58 public:
59 explicit Thread(bool deleteSelfOnFinish = false);
59 virtual ~Thread(); 60 virtual ~Thread();
60 virtual void Run() = 0; 61 virtual void Run() = 0;
61 void Start(); 62 void Start();
62 void Join(); 63 void Join();
63 64 private:
65 static void CallRun(Thread* thread);
64 private: 66 private:
65 #ifdef WIN32 67 #ifdef WIN32
66 HANDLE nativeThread; 68 HANDLE nativeThread;
67 #else 69 #else
68 pthread_t nativeThread; 70 pthread_t nativeThread;
69 #endif 71 #endif
72 bool m_deleteSelfOnFinish;
70 }; 73 };
71 } 74 }
72 75
73 #endif 76 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld