You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
(5) |
|
2
(2) |
3
(3) |
4
(2) |
5
(4) |
6
(4) |
7
(1) |
8
|
|
9
|
10
(1) |
11
|
12
(3) |
13
(2) |
14
(2) |
15
|
|
16
|
17
|
18
|
19
(2) |
20
(10) |
21
|
22
(6) |
|
23
(7) |
24
|
25
(2) |
26
|
27
(1) |
28
(8) |
29
(2) |
|
30
|
31
|
|
|
|
|
|
|
From: Bart V. A. <bva...@so...> - 2018-12-06 02:16:59
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=43699f30f62db2350ed938972a548f91039affb0 commit 43699f30f62db2350ed938972a548f91039affb0 Author: Andreas Arnez <ar...@li...> Date: Wed Dec 5 17:07:05 2018 +0100 Add Emacs configuration files This adds a configuration file ".dir-locals.el" for Emacs to the topmost directory of the Valgrind source tree, and another such file to the directory drd/tests. These files contain per-directory local Emacs variables. The following settings are performed: * The base C style is set to "Linux", indentation is set to 3 columns per level, the use of tabs for indentation is disabled, and the fill column is set to 80. * The source files in drd/tests use 2 instead of 3 columns per indentation level. Diff: --- .dir-locals.el | 18 ++++++++++++++++++ drd/tests/.dir-locals.el | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..5957ed9 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,18 @@ +;; Emacs settings for Valgrind. + +( + ;; Format used to turn a bug number into a URL (when displaying it). + (nil . ((bug-reference-url-format . "http://bugs.kde.org/show_bug.cgi?id=%s"))) + + ;; Standard settings for editing C source files. + (c-mode . ( + ;; Apply the Linux style as a base. + (c-file-style . "linux") + ;; Use spaces instead of tabs for indentation. + (indent-tabs-mode . nil) + ;; Indent 3 columns per level. + (c-basic-offset . 3) + ;; Lines should be limited to 80 columns. + (fill-column . 80) + )) +) diff --git a/drd/tests/.dir-locals.el b/drd/tests/.dir-locals.el new file mode 100644 index 0000000..0d94ded --- /dev/null +++ b/drd/tests/.dir-locals.el @@ -0,0 +1,16 @@ +;; Emacs settings for drd tests. + +( + ;; Standard settings for editing C source files. + (c-mode . ( + ;; Apply the Linux style as a base. + (c-file-style . "linux") + ;; Use spaces instead of tabs for indentation. + (indent-tabs-mode . nil) + ;; Indent 2 columns per level. Note that this differs from + ;; the usual Valgrind style. + (c-basic-offset . 2) + ;; Lines should be limited to 80 columns. + (fill-column . 80) + )) +) |
|
From: Andreas A. <ar...@li...> - 2018-12-05 16:07:21
|
On Wed, Dec 05 2018, Bart Van Assche wrote: > If nobody comes up with a solution, please repost v2 of your patch but > without the emacs modelines. So I guess we drop the idea of marking the imported files read-only, right? Or did you have a better option? Anyway, I'm OK with that. It basically means that the directory coregrind/m_demangle is not handled specially at all. New version below. -- Andreas -- >8 -- Subject: [PATCH v3] Add Emacs configuration files This adds a configuration file ".dir-locals.el" for Emacs to the topmost directory of the Valgrind source tree, and another such file to the directory drd/tests. These files contain per-directory local Emacs variables. The following settings are performed: * The base C style is set to "Linux", indentation is set to 3 columns per level, the use of tabs for indentation is disabled, and the fill column is set to 80. * The source files in drd/tests use 2 instead of 3 columns per indentation level. --- .dir-locals.el | 18 ++++++++++++++++++ drd/tests/.dir-locals.el | 16 ++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .dir-locals.el create mode 100644 drd/tests/.dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 000000000..5957ed944 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,18 @@ +;; Emacs settings for Valgrind. + +( + ;; Format used to turn a bug number into a URL (when displaying it). + (nil . ((bug-reference-url-format . "http://bugs.kde.org/show_bug.cgi?id=%s"))) + + ;; Standard settings for editing C source files. + (c-mode . ( + ;; Apply the Linux style as a base. + (c-file-style . "linux") + ;; Use spaces instead of tabs for indentation. + (indent-tabs-mode . nil) + ;; Indent 3 columns per level. + (c-basic-offset . 3) + ;; Lines should be limited to 80 columns. + (fill-column . 80) + )) +) diff --git a/drd/tests/.dir-locals.el b/drd/tests/.dir-locals.el new file mode 100644 index 000000000..0d94ded88 --- /dev/null +++ b/drd/tests/.dir-locals.el @@ -0,0 +1,16 @@ +;; Emacs settings for drd tests. + +( + ;; Standard settings for editing C source files. + (c-mode . ( + ;; Apply the Linux style as a base. + (c-file-style . "linux") + ;; Use spaces instead of tabs for indentation. + (indent-tabs-mode . nil) + ;; Indent 2 columns per level. Note that this differs from + ;; the usual Valgrind style. + (c-basic-offset . 2) + ;; Lines should be limited to 80 columns. + (fill-column . 80) + )) +) -- 2.17.0 |
|
From: Bart V. A. <bva...@ac...> - 2018-12-05 15:02:46
|
On 12/5/18 4:30 AM, Andreas Arnez wrote:
> On Tue, Dec 04 2018, Patrick J. LoPresti wrote:
>
>> The example in the documentation:
>>
>> ((nil . ((indent-tabs-mode . t)
>> (fill-column . 80)))
>> (c-mode . ((c-file-style . "BSD")
>> (subdirs . nil)))
>> ("src/imported"
>> . ((nil . ((change-log-default-name
>> . "ChangeLog.local"))))))
>>
>> ...provides settings for src/imported that apply for any mode, but
>> that is just this example... If you replace the nil (under
>> "src/imported") with a mode name, it should apply only for that
>> directory and that mode, I think.
>
> No, if I do that and keep the global mode-specific setting, then the
> latter seems to be applied unconditionally. Do you know a way to avoid
> that?
If nobody comes up with a solution, please repost v2 of your patch but
without the emacs modelines.
Thanks,
Bart.
|
|
From: Andreas A. <ar...@li...> - 2018-12-05 12:31:22
|
On Tue, Dec 04 2018, Patrick J. LoPresti wrote:
> The example in the documentation:
>
> ((nil . ((indent-tabs-mode . t)
> (fill-column . 80)))
> (c-mode . ((c-file-style . "BSD")
> (subdirs . nil)))
> ("src/imported"
> . ((nil . ((change-log-default-name
> . "ChangeLog.local"))))))
>
> ...provides settings for src/imported that apply for any mode, but
> that is just this example... If you replace the nil (under
> "src/imported") with a mode name, it should apply only for that
> directory and that mode, I think.
No, if I do that and keep the global mode-specific setting, then the
latter seems to be applied unconditionally. Do you know a way to avoid
that?
--
Andreas
|
|
From: Patrick J. L. <lop...@gm...> - 2018-12-05 01:21:40
|
On Tue, Dec 4, 2018 at 1:24 AM Andreas Arnez <ar...@li...> wrote: > > > > > According to the documentation: > > > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html > > > > ...a top-level .dir-locals.el can specify settings for particular subdirectories. > > Yes, I know that. This is exclusive of specifying settings for specific > modes, though. Or maybe I overlooked something. Can you provide an > example that does what we want? The example in the documentation: ((nil . ((indent-tabs-mode . t) (fill-column . 80))) (c-mode . ((c-file-style . "BSD") (subdirs . nil))) ("src/imported" . ((nil . ((change-log-default-name . "ChangeLog.local")))))) ...provides settings for src/imported that apply for any mode, but that is just this example... If you replace the nil (under "src/imported") with a mode name, it should apply only for that directory and that mode, I think. - Pat |
|
From: Andreas A. <ar...@li...> - 2018-12-04 09:31:37
|
On Mon, Dec 03 2018, Bart Van Assche wrote:
> On Mon, 2018-12-03 at 20:11 +0100, Andreas Arnez wrote:
[...]
>> Not sure. Do you know another way to exempt these files from being
>> marked read-only?
>
> Are these modelines necessary since your patch adds the following to
> .dir-locals.el?
>
> + ("coregrind/m_demangle"
> + ;; Most files in this directory should not be edited; they are imported
> + ;; from libiberty through the auxprogs/update-demangler script.
> + . ((nil . ((buffer-read-only . t))))
> + )
Right.
>
>> > How about Helgrind? Are files in helgrind/tests indented by 2 or by 3
>> > columns? Is a similar file needed in helgrind/tests?
>>
>> The C source files in that directory use various different indentation
>> widths, sometimes even within the same file. I haven't measured which
>> of these occurs most often, but it's certainly not obvious. So maybe we
>> could just as well postulate that these files should converge to
>> Valgrind's usual style. What do you think?
>
> That sounds fine to me. But since Julian is maintaining Helgrind, Julian
> has the last word about Helgrind test indentation.
Sure.
--
Andreas
|
|
From: Andreas A. <ar...@li...> - 2018-12-04 09:24:21
|
On Mon, Dec 03 2018, Patrick J. LoPresti wrote: > On Mon, Dec 3, 2018 at 11:14 AM Andreas Arnez <ar...@li...> wrote: > > Not sure. Do you know another way to exempt these files from being > marked read-only? > > ... > > > Is it possible to combine the top-level .dir-locals.el file and this file > > into a single file? If not, don't worry. > > If you know how, I'd be interested... > > According to the documentation: > > https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html > > ...a top-level .dir-locals.el can specify settings for particular subdirectories. Yes, I know that. This is exclusive of specifying settings for specific modes, though. Or maybe I overlooked something. Can you provide an example that does what we want? -- Andreas |
|
From: Patrick J. L. <lop...@gm...> - 2018-12-03 20:37:24
|
On Mon, Dec 3, 2018 at 11:14 AM Andreas Arnez <ar...@li...> wrote: > > Not sure. Do you know another way to exempt these files from being > marked read-only? > ... > > Is it possible to combine the top-level .dir-locals.el file and this file > > into a single file? If not, don't worry. If you know how, I'd be interested... > According to the documentation: https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html ...a top-level .dir-locals.el can specify settings for particular subdirectories. - Pat |
|
From: Bart V. A. <bva...@ac...> - 2018-12-03 19:35:27
|
On Mon, 2018-12-03 at 20:11 +0100, Andreas Arnez wrote:
> On Sat, Dec 01 2018, Bart Van Assche wrote:
> > On 11/21/18 8:47 AM, Andreas Arnez wrote:
> > > diff --git a/coregrind/m_demangle/demangle.c b/coregrind/m_demangle/demangle.c
> > > index 00fa20389..dd933da8b 100644
> > > --- a/coregrind/m_demangle/demangle.c
> > > +++ b/coregrind/m_demangle/demangle.c
> > > @@ -1,3 +1,4 @@
> > > +/* -*- mode: C; buffer-read-only: nil -*- */
> > > /*--------------------------------------------------------------------*/
> > > /*--- Demangling of C++ mangled names. demangle.c ---*/
> > > diff --git a/coregrind/m_demangle/vg_libciface.h b/coregrind/m_demangle/vg_libciface.h
> > > index 762e63a02..1aefd5db3 100644
> > > --- a/coregrind/m_demangle/vg_libciface.h
> > > +++ b/coregrind/m_demangle/vg_libciface.h
> > > @@ -1,3 +1,4 @@
> > > +/* -*- mode: C; buffer-read-only: nil -*- */
> >
> > Can this be left out? I'd like to avoid mode lines in source files.
>
> Not sure. Do you know another way to exempt these files from being
> marked read-only?
Are these modelines necessary since your patch adds the following to
.dir-locals.el?
+ ("coregrind/m_demangle"
+ ;; Most files in this directory should not be edited; they are imported
+ ;; from libiberty through the auxprogs/update-demangler script.
+ . ((nil . ((buffer-read-only . t))))
+ )
> > How about Helgrind? Are files in helgrind/tests indented by 2 or by 3
> > columns? Is a similar file needed in helgrind/tests?
>
> The C source files in that directory use various different indentation
> widths, sometimes even within the same file. I haven't measured which
> of these occurs most often, but it's certainly not obvious. So maybe we
> could just as well postulate that these files should converge to
> Valgrind's usual style. What do you think?
That sounds fine to me. But since Julian is maintaining Helgrind, Julian
has the last word about Helgrind test indentation.
Bart.
|
|
From: Andreas A. <ar...@li...> - 2018-12-03 19:13:27
|
On Sat, Dec 01 2018, Bart Van Assche wrote: > On 11/21/18 8:47 AM, Andreas Arnez wrote: >> diff --git a/coregrind/m_demangle/demangle.c b/coregrind/m_demangle/demangle.c >> index 00fa20389..dd933da8b 100644 >> --- a/coregrind/m_demangle/demangle.c >> +++ b/coregrind/m_demangle/demangle.c >> @@ -1,3 +1,4 @@ >> +/* -*- mode: C; buffer-read-only: nil -*- */ >> /*--------------------------------------------------------------------*/ >> /*--- Demangling of C++ mangled names. demangle.c ---*/ >> diff --git a/coregrind/m_demangle/vg_libciface.h b/coregrind/m_demangle/vg_libciface.h >> index 762e63a02..1aefd5db3 100644 >> --- a/coregrind/m_demangle/vg_libciface.h >> +++ b/coregrind/m_demangle/vg_libciface.h >> @@ -1,3 +1,4 @@ >> +/* -*- mode: C; buffer-read-only: nil -*- */ > > Can this be left out? I'd like to avoid mode lines in source files. Not sure. Do you know another way to exempt these files from being marked read-only? > >> diff --git a/drd/tests/.dir-locals.el b/drd/tests/.dir-locals.el >> new file mode 100644 >> index 000000000..0d94ded88 >> --- /dev/null >> +++ b/drd/tests/.dir-locals.el >> @@ -0,0 +1,16 @@ >> +;; Emacs settings for drd tests. >> + >> +( >> + ;; Standard settings for editing C source files. >> + (c-mode . ( >> + ;; Apply the Linux style as a base. >> + (c-file-style . "linux") >> + ;; Use spaces instead of tabs for indentation. >> + (indent-tabs-mode . nil) >> + ;; Indent 2 columns per level. Note that this differs from >> + ;; the usual Valgrind style. >> + (c-basic-offset . 2) >> + ;; Lines should be limited to 80 columns. >> + (fill-column . 80) >> + )) >> +) > > Is it possible to combine the top-level .dir-locals.el file and this file > into a single file? If not, don't worry. If you know how, I'd be interested... > > How about Helgrind? Are files in helgrind/tests indented by 2 or by 3 > columns? Is a similar file needed in helgrind/tests? The C source files in that directory use various different indentation widths, sometimes even within the same file. I haven't measured which of these occurs most often, but it's certainly not obvious. So maybe we could just as well postulate that these files should converge to Valgrind's usual style. What do you think? > > Sorry for being slow in replying. > > Thanks, > > Bart. |
|
From: Mark W. <ma...@so...> - 2018-12-02 11:44:03
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=206e81e8add574bbb38c11105005decedabc2f4a commit 206e81e8add574bbb38c11105005decedabc2f4a Author: Mark Wielaard <ma...@kl...> Date: Sun Dec 2 12:39:27 2018 +0100 Fix tsan_unittest.cpp compile error with older compilers. Older compilers (g++ 4.8.5) don't like '>>': error: â>>â should be â> >â within a nested template argument list. Add an extra space. Diff: --- drd/tests/tsan_unittest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drd/tests/tsan_unittest.cpp b/drd/tests/tsan_unittest.cpp index c504e9f..16fe837 100644 --- a/drd/tests/tsan_unittest.cpp +++ b/drd/tests/tsan_unittest.cpp @@ -7218,7 +7218,7 @@ bool NoElementsLeft(vector<int> *v) { } void WaitForAllThreadsToFinish_Good() { - mu.LockWhen(Condition<vector<int>>(NoElementsLeft, vec)); + mu.LockWhen(Condition<vector<int> >(NoElementsLeft, vec)); mu.Unlock(); // It is now safe to access vec w/o lock. |
|
From: Bart V. A. <bva...@so...> - 2018-12-02 06:06:08
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=65dcbc70db71a17b057637d1b01495ffeba2d967 commit 65dcbc70db71a17b057637d1b01495ffeba2d967 Author: Bart Van Assche <bva...@ac...> Date: Sat Dec 1 21:51:06 2018 -0800 drd/tests: Fix remaining gcc 8 compiler warnings Diff: --- drd/tests/tsan_thread_wrappers_pthread.h | 71 +++++++++++++++++++------------- drd/tests/tsan_unittest.cpp | 38 ++++++++--------- 2 files changed, 62 insertions(+), 47 deletions(-) diff --git a/drd/tests/tsan_thread_wrappers_pthread.h b/drd/tests/tsan_thread_wrappers_pthread.h index 7072fea..bdca574 100644 --- a/drd/tests/tsan_thread_wrappers_pthread.h +++ b/drd/tests/tsan_thread_wrappers_pthread.h @@ -156,22 +156,23 @@ class SpinLock { #endif // NO_SPINLOCK /// Just a boolean condition. Used by Mutex::LockWhen and similar. +template <typename T> class Condition { public: typedef bool (*func_t)(void*); - template <typename T> Condition(bool (*func)(T*), T* arg) - : func_(reinterpret_cast<func_t>(func)), arg_(arg) {} + : func1_(func), arg_(arg) {} Condition(bool (*func)()) - : func_(reinterpret_cast<func_t>(func)), arg_(NULL) {} + : func0_(func), arg_(NULL) {} - bool Eval() { return func_(arg_); } - private: - func_t func_; - void *arg_; + bool Eval() const { return func1_ ? func1_(arg_) : func0_(); } + private: + bool (*func0_)(); + bool (*func1_)(T*); + T *arg_; }; @@ -211,20 +212,27 @@ class Mutex { bool ReaderTryLock() { return TryLock();} void ReaderUnlock() { Unlock(); } - void LockWhen(Condition cond) { Lock(); WaitLoop(cond); } - void ReaderLockWhen(Condition cond) { Lock(); WaitLoop(cond); } - void Await(Condition cond) { WaitLoop(cond); } + template <typename T> + void LockWhen(const Condition<T>& cond) { Lock(); WaitLoop(cond); } + template <typename T> + void ReaderLockWhen(const Condition<T>& cond) { Lock(); WaitLoop(cond); } + template <typename T> + void Await(const Condition<T>& cond) { WaitLoop(cond); } - bool ReaderLockWhenWithTimeout(Condition cond, int millis) + template <typename T> + bool ReaderLockWhenWithTimeout(const Condition<T>& cond, int millis) { Lock(); return WaitLoopWithTimeout(cond, millis); } - bool LockWhenWithTimeout(Condition cond, int millis) + template <typename T> + bool LockWhenWithTimeout(const Condition<T>& cond, int millis) { Lock(); return WaitLoopWithTimeout(cond, millis); } - bool AwaitWithTimeout(Condition cond, int millis) + template <typename T> + bool AwaitWithTimeout(const Condition<T>& cond, int millis) { return WaitLoopWithTimeout(cond, millis); } private: - void WaitLoop(Condition cond) { + template <typename T> + void WaitLoop(const Condition<T>& cond) { signal_at_unlock_ = true; while(cond.Eval() == false) { pthread_cond_wait(&cv_, &mu_); @@ -232,7 +240,8 @@ class Mutex { ANNOTATE_CONDVAR_LOCK_WAIT(&cv_, &mu_); } - bool WaitLoopWithTimeout(Condition cond, int millis) { + template <typename T> + bool WaitLoopWithTimeout(const Condition<T>& cond, int millis) { struct timeval now; struct timespec timeout; int retcode = 0; @@ -341,28 +350,34 @@ class WriterLockScoped { // Scoped RWLock Locker/Unlocker /// Wrapper for pthread_create()/pthread_join(). class MyThread { public: - typedef void *(*worker_t)(void*); - - MyThread(worker_t worker, void *arg = NULL, const char *name = NULL) - :w_(worker), arg_(arg), name_(name) {} + MyThread(void* (*worker)(void *), void *arg = NULL, const char *name = NULL) + :wpvpv_(worker), arg_(arg), name_(name) {} MyThread(void (*worker)(void), void *arg = NULL, const char *name = NULL) - :w_(reinterpret_cast<worker_t>(worker)), arg_(arg), name_(name) {} + :wvv_(worker), arg_(arg), name_(name) {} MyThread(void (*worker)(void *), void *arg = NULL, const char *name = NULL) - :w_(reinterpret_cast<worker_t>(worker)), arg_(arg), name_(name) {} + :wvpv_(worker), arg_(arg), name_(name) {} - ~MyThread(){ w_ = NULL; arg_ = NULL;} - void Start() { CHECK(0 == pthread_create(&t_, NULL, (worker_t)ThreadBody, this));} + void Start() { CHECK(0 == pthread_create(&t_, NULL, ThreadBody, this));} void Join() { CHECK(0 == pthread_join(t_, NULL));} pthread_t tid() const { return t_; } private: - static void ThreadBody(MyThread *my_thread) { + static void *ThreadBody(void *arg) { + MyThread *my_thread = reinterpret_cast<MyThread*>(arg); if (my_thread->name_) { ANNOTATE_THREAD_NAME(my_thread->name_); } - my_thread->w_(my_thread->arg_); + if (my_thread->wpvpv_) + return my_thread->wpvpv_(my_thread->arg_); + if (my_thread->wpvpv_) + my_thread->wvpv_(my_thread->arg_); + if (my_thread->wvv_) + my_thread->wvv_(); + return NULL; } pthread_t t_; - worker_t w_; + void *(*wpvpv_)(void*); + void (*wvv_)(void); + void (*wvpv_)(void*); void *arg_; const char *name_; }; @@ -391,7 +406,7 @@ class ProducerConsumerQueue { // Get. // Blocks if the queue is empty. void *Get() { - mu_.LockWhen(Condition(IsQueueNotEmpty, &q_)); + mu_.LockWhen(Condition<typeof(q_)>(IsQueueNotEmpty, &q_)); void * item = NULL; bool ok = TryGetInternal(&item); CHECK(ok); @@ -578,7 +593,7 @@ class BlockingCounter { return count_ == 0; } void Wait() { - mu_.LockWhen(Condition(&IsZero, &count_)); + mu_.LockWhen(Condition<int>(&IsZero, &count_)); mu_.Unlock(); } private: diff --git a/drd/tests/tsan_unittest.cpp b/drd/tests/tsan_unittest.cpp index 79fea6b..c504e9f 100644 --- a/drd/tests/tsan_unittest.cpp +++ b/drd/tests/tsan_unittest.cpp @@ -437,7 +437,7 @@ void Waiter() { pool.StartWorkers(); COND = 0; pool.Add(NewCallback(Waker)); - MU.LockWhen(Condition(&ArgIsOne, &COND)); // calls ANNOTATE_CONDVAR_WAIT + MU.LockWhen(Condition<int>(&ArgIsOne, &COND)); // calls ANNOTATE_CONDVAR_WAIT MU.Unlock(); // Waker is done! GLOB = 2; @@ -621,7 +621,7 @@ void Waiter() { t.Start(); usleep(100000); // Make sure the signaller gets there first. - MU.LockWhen(Condition(&ArgIsTrue, &COND)); // calls ANNOTATE_CONDVAR_WAIT + MU.LockWhen(Condition<bool>(&ArgIsTrue, &COND));// calls ANNOTATE_CONDVAR_WAIT MU.Unlock(); // Signaller is done! GLOB = 2; // If LockWhen didn't catch the signal, a race may be reported here. @@ -866,7 +866,7 @@ void Waiter() { GLOB++; MU.Unlock(); - MU.LockWhen(Condition(&ArgIsOne, &COND)); + MU.LockWhen(Condition<int>(&ArgIsOne, &COND)); MU.Unlock(); GLOB++; } @@ -950,7 +950,7 @@ void Waker() { }; void Waiter() { - MU.LockWhen(Condition(&ArgIsOne, &COND)); + MU.LockWhen(Condition<int>(&ArgIsOne, &COND)); MU.Unlock(); CHECK(GLOB != 777); } @@ -1001,7 +1001,7 @@ void Worker() { MU2.Lock(); COND--; ANNOTATE_CONDVAR_SIGNAL(&MU2); - MU2.Await(Condition(&ArgIsZero, &COND)); + MU2.Await(Condition<int>(&ArgIsZero, &COND)); MU2.Unlock(); CHECK(GLOB == 2); @@ -1035,7 +1035,7 @@ void Worker() { MU2.Lock(); COND--; ANNOTATE_CONDVAR_SIGNAL(&MU2); - MU2.Await(Condition(&ArgIsZero, &COND)); + MU2.Await(Condition<int>(&ArgIsZero, &COND)); MU2.Unlock(); CHECK(GLOB == 3); @@ -1075,7 +1075,7 @@ void Waiter() { pool.Add(NewCallback(Waker)); MU.Lock(); - MU.Await(Condition(&ArgIsOne, &COND)); // calls ANNOTATE_CONDVAR_WAIT + MU.Await(Condition<int>(&ArgIsOne, &COND)); // calls ANNOTATE_CONDVAR_WAIT MU.Unlock(); // Waker is done! GLOB = 2; @@ -1108,7 +1108,7 @@ void Waiter() { pool.Add(NewCallback(Waker)); MU.Lock(); - CHECK(MU.AwaitWithTimeout(Condition(&ArgIsOne, &COND), INT_MAX)); + CHECK(MU.AwaitWithTimeout(Condition<int>(&ArgIsOne, &COND), INT_MAX)); MU.Unlock(); GLOB = 2; @@ -1137,7 +1137,7 @@ void Waiter() { pool.Add(NewCallback(Waker)); MU.Lock(); - CHECK(!MU.AwaitWithTimeout(Condition(&ArgIsOne, &COND), 100)); + CHECK(!MU.AwaitWithTimeout(Condition<int>(&ArgIsOne, &COND), 100)); MU.Unlock(); GLOB = 2; @@ -1167,7 +1167,7 @@ void Waiter() { COND = 0; pool.Add(NewCallback(Waker)); - CHECK(!MU.LockWhenWithTimeout(Condition(&ArgIsOne, &COND), 100)); + CHECK(!MU.LockWhenWithTimeout(Condition<int>(&ArgIsOne, &COND), 100)); MU.Unlock(); GLOB = 2; @@ -1300,7 +1300,7 @@ void Waiter() { pool.StartWorkers(); COND = 0; pool.Add(NewCallback(Waker)); - MU.ReaderLockWhen(Condition(&ArgIsOne, &COND)); + MU.ReaderLockWhen(Condition<int>(&ArgIsOne, &COND)); MU.ReaderUnlock(); GLOB = 2; @@ -1333,7 +1333,7 @@ void Waiter() { pool.StartWorkers(); COND = 0; pool.Add(NewCallback(Waker)); - CHECK(MU.ReaderLockWhenWithTimeout(Condition(&ArgIsOne, &COND), INT_MAX)); + CHECK(MU.ReaderLockWhenWithTimeout(Condition<int>(&ArgIsOne, &COND), INT_MAX)); MU.ReaderUnlock(); GLOB = 2; @@ -1361,7 +1361,7 @@ void Waiter() { pool.StartWorkers(); COND = 0; pool.Add(NewCallback(Waker)); - CHECK(!MU.ReaderLockWhenWithTimeout(Condition(&ArgIsOne, &COND), 100)); + CHECK(!MU.ReaderLockWhenWithTimeout(Condition<int>(&ArgIsOne, &COND), 100)); MU.ReaderUnlock(); GLOB = 2; @@ -4185,7 +4185,7 @@ struct B: A { // The race is here. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< printf("B::~B()\n"); // wait until flag_stopped is true. - mu.LockWhen(Condition(&ArgIsTrue, &flag_stopped)); + mu.LockWhen(Condition<bool>(&ArgIsTrue, &flag_stopped)); mu.Unlock(); printf("B::~B() done\n"); } @@ -4256,7 +4256,7 @@ struct B: A { // The race is here. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< printf("B::~B()\n"); // wait until flag_stopped is true. - mu.LockWhen(Condition(&ArgIsTrue, &flag_stopped)); + mu.LockWhen(Condition<bool>(&ArgIsTrue, &flag_stopped)); mu.Unlock(); printf("B::~B() done\n"); } @@ -4825,7 +4825,7 @@ Mutex mu; static void Thread1() { for (int i = 0; i < 100; i++) { - mu.LockWhenWithTimeout(Condition(&ArgIsTrue, &GLOB), 5); + mu.LockWhenWithTimeout(Condition<bool>(&ArgIsTrue, &GLOB), 5); GLOB = false; mu.Unlock(); usleep(10000); @@ -5338,7 +5338,7 @@ static bool ArgIsTrue(bool *arg) { void f1() { char some_stack[N]; write_to_p(some_stack, 1); - mu.LockWhen(Condition(&ArgIsTrue, &COND)); + mu.LockWhen(Condition<bool>(&ArgIsTrue, &COND)); mu.Unlock(); } @@ -6098,7 +6098,7 @@ bool WeirdCondition(int* param) { } void Waiter() { int param = 0; - MU.ReaderLockWhen(Condition(WeirdCondition, ¶m)); + MU.ReaderLockWhen(Condition<int>(WeirdCondition, ¶m)); MU.ReaderUnlock(); CHECK(GLOB > 0); CHECK(param > 0); @@ -7218,7 +7218,7 @@ bool NoElementsLeft(vector<int> *v) { } void WaitForAllThreadsToFinish_Good() { - mu.LockWhen(Condition(NoElementsLeft, vec)); + mu.LockWhen(Condition<vector<int>>(NoElementsLeft, vec)); mu.Unlock(); // It is now safe to access vec w/o lock. |
|
From: Bart V. A. <bva...@ac...> - 2018-12-01 20:22:39
|
On 11/21/18 8:47 AM, Andreas Arnez wrote: > diff --git a/coregrind/m_demangle/demangle.c b/coregrind/m_demangle/demangle.c > index 00fa20389..dd933da8b 100644 > --- a/coregrind/m_demangle/demangle.c > +++ b/coregrind/m_demangle/demangle.c > @@ -1,3 +1,4 @@ > +/* -*- mode: C; buffer-read-only: nil -*- */ > > /*--------------------------------------------------------------------*/ > /*--- Demangling of C++ mangled names. demangle.c ---*/ > diff --git a/coregrind/m_demangle/vg_libciface.h b/coregrind/m_demangle/vg_libciface.h > index 762e63a02..1aefd5db3 100644 > --- a/coregrind/m_demangle/vg_libciface.h > +++ b/coregrind/m_demangle/vg_libciface.h > @@ -1,3 +1,4 @@ > +/* -*- mode: C; buffer-read-only: nil -*- */ Can this be left out? I'd like to avoid mode lines in source files. > diff --git a/drd/tests/.dir-locals.el b/drd/tests/.dir-locals.el > new file mode 100644 > index 000000000..0d94ded88 > --- /dev/null > +++ b/drd/tests/.dir-locals.el > @@ -0,0 +1,16 @@ > +;; Emacs settings for drd tests. > + > +( > + ;; Standard settings for editing C source files. > + (c-mode . ( > + ;; Apply the Linux style as a base. > + (c-file-style . "linux") > + ;; Use spaces instead of tabs for indentation. > + (indent-tabs-mode . nil) > + ;; Indent 2 columns per level. Note that this differs from > + ;; the usual Valgrind style. > + (c-basic-offset . 2) > + ;; Lines should be limited to 80 columns. > + (fill-column . 80) > + )) > +) Is it possible to combine the top-level .dir-locals.el file and this file into a single file? If not, don't worry. How about Helgrind? Are files in helgrind/tests indented by 2 or by 3 columns? Is a similar file needed in helgrind/tests? Sorry for being slow in replying. Thanks, Bart. |
|
From: Bart V. A. <bva...@so...> - 2018-12-01 19:08:42
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4b90a2e668d01e37d82560bc2cd61f99163193cf commit 4b90a2e668d01e37d82560bc2cd61f99163193cf Author: Bart Van Assche <bva...@ac...> Date: Sat Dec 1 08:42:55 2018 -0800 Add drd/tests/fork-serial and drd/tests/fork-parallel Diff: --- drd/tests/Makefile.am | 4 ++++ drd/tests/fork-parallel.stderr.exp | 5 +++++ drd/tests/fork-parallel.vgtest | 3 +++ drd/tests/fork-serial.stderr.exp | 5 +++++ drd/tests/fork-serial.vgtest | 3 +++ 5 files changed, 20 insertions(+) diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index 99dfefa..fec3f46 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -109,6 +109,10 @@ EXTRA_DIST = \ dlopen.stderr.exp \ dlopen.stdout.exp \ dlopen.vgtest \ + fork-serial.stderr.exp \ + fork-serial.vgtest \ + fork-parallel.stderr.exp \ + fork-parallel.vgtest \ fp_race.stderr.exp \ fp_race.stderr.exp-mips32-be \ fp_race.stderr.exp-mips32-le \ diff --git a/drd/tests/fork-parallel.stderr.exp b/drd/tests/fork-parallel.stderr.exp new file mode 100644 index 0000000..54b7666 --- /dev/null +++ b/drd/tests/fork-parallel.stderr.exp @@ -0,0 +1,5 @@ + +/bin/ls +/bin/ls + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/drd/tests/fork-parallel.vgtest b/drd/tests/fork-parallel.vgtest new file mode 100644 index 0000000..0943f8b --- /dev/null +++ b/drd/tests/fork-parallel.vgtest @@ -0,0 +1,3 @@ +prereq: ./supported_libpthread +vgopts: --check-stack-var=yes --read-var-info=yes --show-confl-seg=no +prog: fork 1 diff --git a/drd/tests/fork-serial.stderr.exp b/drd/tests/fork-serial.stderr.exp new file mode 100644 index 0000000..54b7666 --- /dev/null +++ b/drd/tests/fork-serial.stderr.exp @@ -0,0 +1,5 @@ + +/bin/ls +/bin/ls + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) diff --git a/drd/tests/fork-serial.vgtest b/drd/tests/fork-serial.vgtest new file mode 100644 index 0000000..94ca168 --- /dev/null +++ b/drd/tests/fork-serial.vgtest @@ -0,0 +1,3 @@ +prereq: ./supported_libpthread +vgopts: --check-stack-var=yes --read-var-info=yes --show-confl-seg=no +prog: fork |
|
From: Bart V. A. <bva...@so...> - 2018-12-01 19:08:35
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=66a7a592c072c1dee1e9083a19afcc6c0c1b7e76 commit 66a7a592c072c1dee1e9083a19afcc6c0c1b7e76 Author: Bart Van Assche <bva...@ac...> Date: Fri Nov 30 20:49:27 2018 -0800 drd: Add fork test program Diff: --- .gitignore | 1 + drd/tests/Makefile.am | 1 + drd/tests/fork.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/.gitignore b/.gitignore index e88e3b3..a17d631 100644 --- a/.gitignore +++ b/.gitignore @@ -320,6 +320,7 @@ /drd/tests/dlopen_lib.so /drd/tests/dlopen_main /drd/tests/drd_bitmap_test +/drd/tests/fork /drd/tests/fp_race /drd/tests/free_is_write /drd/tests/hg01_all_ok diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index d09ca5f..99dfefa 100644 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -370,6 +370,7 @@ check_PROGRAMS = \ concurrent_close \ dlopen_main \ dlopen_lib.so \ + fork \ fp_race \ free_is_write \ hold_lock \ diff --git a/drd/tests/fork.c b/drd/tests/fork.c new file mode 100644 index 0000000..07aaf73 --- /dev/null +++ b/drd/tests/fork.c @@ -0,0 +1,45 @@ +#include <stdio.h> +#include <pthread.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +static pthread_t tid[2]; + +static void *startproc(void *arg) +{ + pid_t pid; + char *argv[] = { "/bin/ls", "/bin/ls", NULL }; + + if ((pid = fork()) == -1) { + perror("fork error"); + } else if (pid == 0) { + dup2(2, 1); // redirect stdout to stderr + execv(argv[0], argv); // child + } + + return NULL; +} + +int main(int argc, char **argv) +{ + // No arguments means serialize the fork() calls. One argument means perform + // both fork() calls concurrently. + int serialize_fork = argc == 1; + int i = 0; + int err; + + for (i = 0; i < 2; i++) { + err = pthread_create(&tid[i], NULL, &startproc, NULL); + if (err != 0) + perror("pthread_create()"); + if (serialize_fork) + pthread_join(tid[i], NULL); + } + if (!serialize_fork) { + for (i = 0; i < 2; i++) + if (tid[i]) + pthread_join(tid[i], NULL); + } + return 0; +} |
|
From: Bart V. A. <bva...@so...> - 2018-12-01 19:08:30
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=df10905d337451489adf82fb68ac2bffae297f89 commit df10905d337451489adf82fb68ac2bffae297f89 Author: Bart Van Assche <bva...@ac...> Date: Sat Dec 1 10:43:06 2018 -0800 drd: Fix fork() handling The thread ID passed to DRD_(drd_thread_atfork_child)() is a Valgrind thread ID instead of a DRD thread ID. This patch fixes bug 401578. Diff: --- NEWS | 1 + drd/drd_thread.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ffaabd7..7b784a8 100644 --- a/NEWS +++ b/NEWS @@ -59,6 +59,7 @@ where XXXXXX is the bug number as listed below. 401277 More bugs in z13 support 401112 LLVM 5.0 generates comparison against partially initialized data 385411 s390x: z13 vector floating-point instructions not implemented +401578 drd: crashes sometimes on fork() Release 3.14.0 (9 October 2018) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/drd/drd_thread.c b/drd/drd_thread.c index 9ada77d..7641a35 100644 --- a/drd/drd_thread.c +++ b/drd/drd_thread.c @@ -570,13 +570,13 @@ void DRD_(thread_finished)(const DrdThreadId tid) } /** Called just after fork() in the child process. */ -void DRD_(drd_thread_atfork_child)(const DrdThreadId tid) +void DRD_(drd_thread_atfork_child)(const ThreadId tid) { unsigned i; for (i = 1; i < DRD_N_THREADS; i++) { - if (i == tid) + if (DRD_(g_threadinfo)[i].vg_threadid == tid) continue; if (DRD_(IsValidDrdThreadId(i))) DRD_(thread_delete)(i, True); |
|
From: Bart V. A. <bva...@so...> - 2018-12-01 19:08:24
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=bb7086d063db5c73de9f64f465f86d9440d2da47 commit bb7086d063db5c73de9f64f465f86d9440d2da47 Author: Bart Van Assche <bva...@ac...> Date: Fri Nov 30 21:15:39 2018 -0800 drd/test: Fix most gcc 8 compiler warnings Diff: --- drd/tests/circular_buffer.c | 18 ++++++++++-------- drd/tests/matinv.c | 6 ++++-- drd/tests/pth_broadcast.c | 8 +++++--- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/drd/tests/circular_buffer.c b/drd/tests/circular_buffer.c index b7ab564..0b75046 100644 --- a/drd/tests/circular_buffer.c +++ b/drd/tests/circular_buffer.c @@ -156,17 +156,21 @@ static void buffer_destroy(buffer_t* b) static buffer_t b; -static void producer(int* id) +static void *producer(void* arg) { + int* id = arg; + buffer_send(&b, id); - pthread_exit(NULL); + return NULL; } #define MAXSLEEP (100 * 1000) -static void consumer(int* id) +static void *consumer(void* arg) { + int* id = arg; int d; + usleep(rand() % MAXSLEEP); buffer_recv(&b, &d); if (! quiet) @@ -174,7 +178,7 @@ static void consumer(int* id) printf("%i: %i\n", *id, d); fflush(stdout); } - pthread_exit(NULL); + return NULL; } #define THREADS (10) @@ -207,13 +211,11 @@ int main(int argc, char** argv) for (i = 0; i < THREADS; ++i) { thread_arg[i] = i; - pthread_create(producers + i, NULL, - (void * (*)(void *)) producer, &thread_arg[i]); + pthread_create(producers + i, NULL, producer, &thread_arg[i]); } for (i = 0; i < THREADS; ++i) - pthread_create(consumers + i, NULL, - (void * (*)(void *)) consumer, &thread_arg[i]); + pthread_create(consumers + i, NULL, consumer, &thread_arg[i]); for (i = 0; i < THREADS; ++i) { diff --git a/drd/tests/matinv.c b/drd/tests/matinv.c index 1e26088..1369a69 100644 --- a/drd/tests/matinv.c +++ b/drd/tests/matinv.c @@ -167,8 +167,9 @@ static elem_t* multiply_matrices(const elem_t* const a1, * submatrix p->a[0..p->rows-1,0..p->rows-1] is the identity matrix. * @see http://en.wikipedia.org/wiki/Gauss-Jordan_elimination */ -static void gj_threadfunc(struct gj_threadinfo* p) +static void *gj_threadfunc(void *arg) { + struct gj_threadinfo* p = arg; int i, j, k; elem_t* const a = p->a; const int rows = p->rows; @@ -217,6 +218,7 @@ static void gj_threadfunc(struct gj_threadinfo* p) } } } + return NULL; } /** Multithreaded Gauss-Jordan algorithm. */ @@ -246,7 +248,7 @@ static void gj(elem_t* const a, const int rows, const int cols) t[i].cols = cols; t[i].r0 = i * rows / s_nthread; t[i].r1 = (i+1) * rows / s_nthread; - pthread_create(&t[i].tid, &attr, (void*(*)(void*))gj_threadfunc, &t[i]); + pthread_create(&t[i].tid, &attr, gj_threadfunc, &t[i]); } pthread_attr_destroy(&attr); diff --git a/drd/tests/pth_broadcast.c b/drd/tests/pth_broadcast.c index 5276a34..21ff4ca 100644 --- a/drd/tests/pth_broadcast.c +++ b/drd/tests/pth_broadcast.c @@ -83,8 +83,9 @@ static pthread_cond_t s_cond; // Function definitions. -static void thread_func(struct cthread* thread_info) +static void *thread_func(void *arg) { + struct cthread* thread_info = arg; int i; pthread_mutex_lock(&s_mutex); @@ -106,6 +107,8 @@ static void thread_func(struct cthread* thread_info) } pthread_mutex_unlock(&s_mutex); + + return NULL; } int main(int argc, char** argv) @@ -151,8 +154,7 @@ int main(int argc, char** argv) cthread_ctr(p); p->m_threadnum = p - thread_vec; p->m_sema = &sema; - pthread_create(&p->m_thread, 0, - (void*(*)(void*))thread_func, &*p); + pthread_create(&p->m_thread, 0, thread_func, &*p); } for (i = 0; i < s_signal_count; i++) { |