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
(1) |
2
(2) |
3
|
4
(1) |
5
(6) |
6
|
|
7
(1) |
8
|
9
(1) |
10
(2) |
11
(6) |
12
(3) |
13
(3) |
|
14
|
15
(11) |
16
(8) |
17
(5) |
18
(5) |
19
(5) |
20
(3) |
|
21
(2) |
22
(4) |
23
(5) |
24
(4) |
25
|
26
|
27
|
|
28
(8) |
|
|
|
|
|
|
|
From: <sv...@va...> - 2010-02-21 20:41:03
|
Author: sewardj
Date: 2010-02-21 20:40:53 +0000 (Sun, 21 Feb 2010)
New Revision: 1961
Log:
CVTPI2PD (which converts 2 x I32 in M64 or MMX to 2 x F64 in XMM):
only switch the x87 FPU to MMX mode in the case where the source
operand is in memory, not in an MMX register. This fixes #210264.
This is all very fishy.
* it's inconsistent with all other instructions which convert between
values in (MMX or M64) and XMM, in that they put the FPU in MMX mode
even if the source is memory, not MMX. (for example, CVTPI2PS).
At least, that's what the Intel docs appear to say.
* the AMD documentation makes no mention at all of this. For example
it makes no differentiation in this matter between CVTPI2PD and
CVTPI2PS.
I wonder if Intel surreptitiously changed the behaviour of CVTPI2PD
since this code was written circa 5 years ago. Or, whether the Intel
and AMD implementations differ in this respect.
Modified:
trunk/priv/guest_amd64_toIR.c
trunk/priv/guest_x86_toIR.c
Modified: trunk/priv/guest_amd64_toIR.c
===================================================================
--- trunk/priv/guest_amd64_toIR.c 2010-02-18 23:01:26 UTC (rev 1960)
+++ trunk/priv/guest_amd64_toIR.c 2010-02-21 20:40:53 UTC (rev 1961)
@@ -10562,8 +10562,14 @@
IRTemp arg64 = newTemp(Ity_I64);
modrm = getUChar(delta+2);
- do_MMX_preamble();
if (epartIsReg(modrm)) {
+ /* Only switch to MMX mode if the source is a MMX register.
+ This is inconsistent with all other instructions which
+ convert between XMM and (M64 or MMX), which always switch
+ to MMX mode even if 64-bit operand is M64 and not MMX. At
+ least, that's what the Intel docs seem to me to say.
+ Fixes #210264. */
+ do_MMX_preamble();
assign( arg64, getMMXReg(eregLO3ofRM(modrm)) );
delta += 2+1;
DIP("cvtpi2pd %s,%s\n", nameMMXReg(eregLO3ofRM(modrm)),
Modified: trunk/priv/guest_x86_toIR.c
===================================================================
--- trunk/priv/guest_x86_toIR.c 2010-02-18 23:01:26 UTC (rev 1960)
+++ trunk/priv/guest_x86_toIR.c 2010-02-21 20:40:53 UTC (rev 1961)
@@ -9508,8 +9508,14 @@
IRTemp arg64 = newTemp(Ity_I64);
modrm = getIByte(delta+2);
- do_MMX_preamble();
if (epartIsReg(modrm)) {
+ /* Only switch to MMX mode if the source is a MMX register.
+ This is inconsistent with all other instructions which
+ convert between XMM and (M64 or MMX), which always switch
+ to MMX mode even if 64-bit operand is M64 and not MMX. At
+ least, that's what the Intel docs seem to me to say.
+ Fixes #210264. */
+ do_MMX_preamble();
assign( arg64, getMMXReg(eregOfRM(modrm)) );
delta += 2+1;
DIP("cvtpi2pd %s,%s\n", nameMMXReg(eregOfRM(modrm)),
|
|
From: <sv...@va...> - 2010-02-21 14:53:11
|
Author: bart
Date: 2010-02-21 14:52:59 +0000 (Sun, 21 Feb 2010)
New Revision: 11052
Log:
Removed trailing whitespace in C source and header files.
Modified:
trunk/drd/drd.h
trunk/drd/drd_bitmap.c
trunk/drd/drd_bitmap.h
trunk/drd/drd_bitmap2_node.c
trunk/drd/drd_clientobj.c
trunk/drd/drd_clientreq.c
trunk/drd/drd_error.c
trunk/drd/drd_error.h
trunk/drd/drd_load_store.c
trunk/drd/drd_load_store.h
trunk/drd/drd_main.c
trunk/drd/drd_malloc_wrappers.c
trunk/drd/drd_pthread_intercepts.c
trunk/drd/drd_qtcore_intercepts.c
trunk/drd/drd_segment.h
trunk/drd/drd_semaphore.c
trunk/drd/drd_strmem_intercepts.c
trunk/drd/drd_suppression.c
trunk/drd/drd_thread.c
trunk/drd/drd_thread.h
trunk/drd/drd_vc.h
trunk/drd/tests/annotate_ignore_rw.c
trunk/drd/tests/annotate_ignore_write.c
trunk/drd/tests/custom_alloc.c
trunk/drd/tests/fp_race.c
trunk/drd/tests/matinv.c
trunk/drd/tests/omp_matinv.c
trunk/drd/tests/pth_broadcast.c
trunk/drd/tests/pth_detached.c
trunk/drd/tests/pth_detached_sem.c
trunk/drd/tests/sem_as_mutex.c
trunk/drd/tests/sem_open.c
trunk/drd/tests/tsan_thread_wrappers_pthread.h
Modified: trunk/drd/drd.h
===================================================================
--- trunk/drd/drd.h 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd.h 2010-02-21 14:52:59 UTC (rev 11052)
@@ -82,7 +82,7 @@
#define DRD_STOP_IGNORING_VAR(x) DRDCL_(ignore_range)(&(x), sizeof(x))
/**
- * Tell DRD to trace all memory accesses on the specified variable.
+ * Tell DRD to trace all memory accesses on the specified variable.
* until the memory that was allocated for the variable is freed.
*/
#define DRD_TRACE_VAR(x) DRDCL_(trace_range)(&(x), sizeof(x))
Modified: trunk/drd/drd_bitmap.c
===================================================================
--- trunk/drd/drd_bitmap.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_bitmap.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -368,7 +368,7 @@
tl_assert(a1 <= b_end && b_end <= a2);
tl_assert(b_start < b_end);
tl_assert(address_lsb(b_start) <= address_lsb(b_end - 1));
-
+
for (b0 = address_lsb(b_start); b0 <= address_lsb(b_end - 1); b0++)
{
if (bm0_is_set(p1->bm0_r, b0))
@@ -421,7 +421,7 @@
tl_assert(a1 <= b_end && b_end <= a2);
tl_assert(b_start < b_end);
tl_assert(address_lsb(b_start) <= address_lsb(b_end - 1));
-
+
for (b0 = address_lsb(b_start); b0 <= address_lsb(b_end - 1); b0++)
{
if (bm0_is_set(p1->bm0_w, b0))
@@ -476,7 +476,7 @@
tl_assert(a1 <= b_end && b_end <= a2);
tl_assert(b_start < b_end);
tl_assert(address_lsb(b_start) <= address_lsb(b_end - 1));
-
+
for (b0 = address_lsb(b_start); b0 <= address_lsb(b_end - 1); b0++)
{
/*
@@ -809,7 +809,7 @@
tl_assert(a1 <= b_end && b_end <= a2);
tl_assert(b_start < b_end);
tl_assert(address_lsb(b_start) <= address_lsb(b_end - 1));
-
+
for (b0 = address_lsb(b_start); b0 <= address_lsb(b_end - 1); b0++)
{
if (access_type == eLoad)
Modified: trunk/drd/drd_bitmap.h
===================================================================
--- trunk/drd/drd_bitmap.h 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_bitmap.h 2010-02-21 14:52:59 UTC (rev 11052)
@@ -41,7 +41,7 @@
/* Client addresses are split into bitfields as follows:
* ------------------------------------------------------
- * | Address MSB | Address LSB | Ignored bits |
+ * | Address MSB | Address LSB | Ignored bits |
* ------------------------------------------------------
* | Address MSB | UWord MSB | UWord LSB | Ignored bits |
* ------------------------------------------------------
@@ -281,7 +281,7 @@
tl_assert(size == 0 || uword_msb(a) == uword_msb(a + size - 1));
#endif
/*
- * Note: although the expression below yields a correct result even if
+ * Note: although the expression below yields a correct result even if
* size == 0, do not touch bm0[] if size == 0 because this might otherwise
* cause an access of memory just past the end of the bm0[] array.
*/
Modified: trunk/drd/drd_bitmap2_node.c
===================================================================
--- trunk/drd/drd_bitmap2_node.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_bitmap2_node.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -118,7 +118,7 @@
/*
* If szB < sizeof(struct bitmap2) then this function has been called to
* allocate an AVL tree root node. Otherwise it has been called to allocate
- * an AVL tree branch or leaf node.
+ * an AVL tree branch or leaf node.
*/
if (szB < sizeof(struct bitmap2))
return VG_(malloc)(ec, szB);
Modified: trunk/drd/drd_clientobj.c
===================================================================
--- trunk/drd/drd_clientobj.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_clientobj.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -113,7 +113,7 @@
{
if (a1 <= p->any.a1 && p->any.a1 < a2)
{
- return True;
+ return True;
}
}
return False;
Modified: trunk/drd/drd_clientreq.c
===================================================================
--- trunk/drd/drd_clientreq.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_clientreq.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -487,7 +487,7 @@
if (DRD_(thread_enter_synchr)(drd_tid) == 0)
DRD_(rwlock_pre_unlock)(arg[1], pthread_rwlock);
break;
-
+
case VG_USERREQ__POST_RWLOCK_UNLOCK:
DRD_(thread_leave_synchr)(drd_tid);
break;
Modified: trunk/drd/drd_error.c
===================================================================
--- trunk/drd/drd_error.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_error.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -190,7 +190,7 @@
/**
* Compare two error contexts. The core function VG_(maybe_record_error)()
* calls this function to compare error contexts such that errors that occur
- * repeatedly are only printed once. This function is only called by the core
+ * repeatedly are only printed once. This function is only called by the core
* if the error kind of e1 and e2 matches and if the ExeContext's of e1 and
* e2 also match.
*/
Modified: trunk/drd/drd_error.h
===================================================================
--- trunk/drd/drd_error.h 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_error.h 2010-02-21 14:52:59 UTC (rev 11052)
@@ -66,13 +66,13 @@
} DrdErrorKind;
/* The classification of a faulting address. */
-typedef
-enum {
+typedef
+enum {
//Undescribed, // as-yet unclassified
- eStack,
+ eStack,
eUnknown, // classification yielded nothing useful
//Freed,
- eMallocd,
+ eMallocd,
eSegment, // in a segment (as defined in pub_tool_debuginfo.h)
//UserG, // in a user-defined block
//Mempool, // in a mempool
Modified: trunk/drd/drd_load_store.c
===================================================================
--- trunk/drd/drd_load_store.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_load_store.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -442,7 +442,7 @@
IRSB* DRD_(instrument)(VgCallbackClosure* const closure,
IRSB* const bb_in,
VexGuestLayout* const layout,
- VexGuestExtents* const vge,
+ VexGuestExtents* const vge,
IRType const gWordTy,
IRType const hWordTy)
{
Modified: trunk/drd/drd_load_store.h
===================================================================
--- trunk/drd/drd_load_store.h 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_load_store.h 2010-02-21 14:52:59 UTC (rev 11052)
@@ -43,7 +43,7 @@
IRSB* DRD_(instrument)(VgCallbackClosure* const closure,
IRSB* const bb_in,
VexGuestLayout* const layout,
- VexGuestExtents* const vge,
+ VexGuestExtents* const vge,
IRType const gWordTy,
IRType const hWordTy);
void DRD_(trace_mem_access)(const Addr addr, const SizeT size,
Modified: trunk/drd/drd_main.c
===================================================================
--- trunk/drd/drd_main.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_main.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -214,7 +214,7 @@
}
static void DRD_(print_debug_usage)(void)
-{
+{
VG_(printf)(
" --drd-stats=yes|no Print statistics about DRD activity [no].\n"
" --trace-clientobj=yes|no Trace all client object activity [no].\n"
@@ -287,7 +287,7 @@
{
DRD_(trace_mem_access)(a1, len, eStart);
}
-
+
if (UNLIKELY(DRD_(running_thread_inside_pthread_create)()))
{
DRD_(start_suppression)(a1, a1 + len, "pthread_create()");
@@ -414,7 +414,7 @@
{
DRD_(thread_set_stack_min)(DRD_(thread_get_running_tid)(),
a - VG_STACK_REDZONE_SZB);
- drd_start_using_mem(a - VG_STACK_REDZONE_SZB,
+ drd_start_using_mem(a - VG_STACK_REDZONE_SZB,
len + VG_STACK_REDZONE_SZB);
}
@@ -567,7 +567,7 @@
{
// thread_print_all();
if (VG_(clo_verbosity) == 1 && !VG_(clo_xml)) {
- VG_(message)(Vg_UserMsg,
+ VG_(message)(Vg_UserMsg,
"For counts of detected and suppressed errors, "
"rerun with: -v\n");
}
Modified: trunk/drd/drd_malloc_wrappers.c
===================================================================
--- trunk/drd/drd_malloc_wrappers.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_malloc_wrappers.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -225,7 +225,7 @@
{
/* Copy from old to new. */
VG_(memcpy)(p_new, p_old, mc->size);
-
+
/* Free old memory. */
VG_(cli_free)(p_old);
if (mc->size > 0)
@@ -243,7 +243,7 @@
{
/* Allocation failed -- leave original block untouched. */
}
- }
+ }
return p_new;
}
@@ -346,7 +346,7 @@
DRD_Chunk* mc;
SizeT nblocks = 0;
SizeT nbytes = 0;
-
+
if (VG_(clo_verbosity) == 0)
return;
if (VG_(clo_xml))
@@ -360,10 +360,10 @@
nbytes += mc->size;
}
- VG_(message)(Vg_DebugMsg,
+ VG_(message)(Vg_DebugMsg,
"malloc/free: in use at exit: %lu bytes in %lu blocks.\n",
nbytes, nblocks);
- VG_(message)(Vg_DebugMsg,
+ VG_(message)(Vg_DebugMsg,
"malloc/free: %lu allocs, %lu frees, %lu bytes allocated.\n",
s_cmalloc_n_mallocs,
s_cmalloc_n_frees, s_cmalloc_bs_mallocd);
Modified: trunk/drd/drd_pthread_intercepts.c
===================================================================
--- trunk/drd/drd_pthread_intercepts.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_pthread_intercepts.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -28,7 +28,7 @@
*/
/* ---------------------------------------------------------------------
- ALL THE CODE IN THIS FILE RUNS ON THE SIMULATED CPU.
+ ALL THE CODE IN THIS FILE RUNS ON THE SIMULATED CPU.
These functions are not called directly - they're the targets of code
redirection or load notifications (see pub_core_redir.h for info).
Modified: trunk/drd/drd_qtcore_intercepts.c
===================================================================
--- trunk/drd/drd_qtcore_intercepts.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_qtcore_intercepts.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -28,7 +28,7 @@
*/
/* ---------------------------------------------------------------------
- ALL THE CODE IN THIS FILE RUNS ON THE SIMULATED CPU.
+ ALL THE CODE IN THIS FILE RUNS ON THE SIMULATED CPU.
These functions are not called directly - they're the targets of code
redirection or load notifications (see pub_core_redir.h for info).
Modified: trunk/drd/drd_segment.h
===================================================================
--- trunk/drd/drd_segment.h 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_segment.h 2010-02-21 14:52:59 UTC (rev 11052)
@@ -28,7 +28,7 @@
/*
- * Segments and segment lists. A segment represents information about
+ * Segments and segment lists. A segment represents information about
* a contiguous group of statements of a specific thread. There is a vector
* clock associated with each segment.
*/
Modified: trunk/drd/drd_semaphore.c
===================================================================
--- trunk/drd/drd_semaphore.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_semaphore.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -445,12 +445,12 @@
const Bool succeeded)
{
/*
- * Note: it is hard to implement the sem_post() wrapper correctly in
- * case sem_post() returns an error code. This is because handling this
- * case correctly requires restoring the vector clock associated with
+ * Note: it is hard to implement the sem_post() wrapper correctly in
+ * case sem_post() returns an error code. This is because handling this
+ * case correctly requires restoring the vector clock associated with
* the semaphore to its original value here. In order to do that without
- * introducing a race condition, extra locking has to be added around
- * each semaphore call. Such extra locking would have to be added in
+ * introducing a race condition, extra locking has to be added around
+ * each semaphore call. Such extra locking would have to be added in
* drd_pthread_intercepts.c. However, it is hard to implement
* synchronization in drd_pthread_intercepts.c in a portable way without
* calling already redirected functions.
Modified: trunk/drd/drd_strmem_intercepts.c
===================================================================
--- trunk/drd/drd_strmem_intercepts.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_strmem_intercepts.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -11,7 +11,7 @@
from memchec/mc_replace_strmem.c, which has the following copyright
notice:
- Copyright (C) 2000-2009 Julian Seward
+ Copyright (C) 2000-2009 Julian Seward
js...@ac...
This program is free software; you can redistribute it and/or
@@ -49,8 +49,8 @@
}
STRNLEN(VG_Z_LIBC_SONAME, strnlen)
-
+
// Note that this replacement often doesn't get used because gcc inlines
// calls to strlen() with its own built-in version. This can be very
// confusing if you aren't expecting it. Other small functions in this file
Modified: trunk/drd/drd_suppression.c
===================================================================
--- trunk/drd/drd_suppression.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_suppression.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -76,7 +76,7 @@
{
VG_(message)(Vg_DebugMsg, "finish suppression of 0x%lx sz %ld\n",
a1, a2 - a1);
- VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
+ VG_(get_and_pp_StackTrace)(VG_(get_running_tid)(), 12);
}
tl_assert(a1 < a2);
Modified: trunk/drd/drd_thread.c
===================================================================
--- trunk/drd/drd_thread.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_thread.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -421,7 +421,7 @@
}
/**
- * Clean up thread-specific data structures. Call this just after
+ * Clean up thread-specific data structures. Call this just after
* pthread_join().
*/
void DRD_(thread_delete)(const DrdThreadId tid)
@@ -561,7 +561,7 @@
{
tl_assert(0 <= (int)tid && tid < DRD_N_THREADS
&& tid != DRD_INVALID_THREADID);
-
+
if (name == NULL || name[0] == 0)
VG_(snprintf)(DRD_(g_threadinfo)[tid].name,
sizeof(DRD_(g_threadinfo)[tid].name),
@@ -602,7 +602,7 @@
{
tl_assert(vg_tid != VG_INVALID_THREADID);
tl_assert(drd_tid != DRD_INVALID_THREADID);
-
+
if (vg_tid != s_vg_running_tid)
{
if (s_trace_context_switches
@@ -1241,8 +1241,8 @@
for (q = DRD_(g_threadinfo)[i].last; q; q = q->prev)
{
/*
- * Since q iterates over the segments of thread i in order of
- * decreasing vector clocks, if q->vc <= p->vc, then
+ * Since q iterates over the segments of thread i in order of
+ * decreasing vector clocks, if q->vc <= p->vc, then
* q->next->vc <= p->vc will also hold. Hence, break out of the
* loop once this condition is met.
*/
Modified: trunk/drd/drd_thread.h
===================================================================
--- trunk/drd/drd_thread.h 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_thread.h 2010-02-21 14:52:59 UTC (rev 11052)
@@ -238,7 +238,7 @@
}
/**
- * Reports whether or not recording of memory loads is enabled for the
+ * Reports whether or not recording of memory loads is enabled for the
* currently running client thread.
*/
static __inline__
@@ -254,7 +254,7 @@
}
/**
- * Reports whether or not recording memory stores is enabled for the
+ * Reports whether or not recording memory stores is enabled for the
* currently running client thread.
*/
static __inline__
Modified: trunk/drd/drd_vc.h
===================================================================
--- trunk/drd/drd_vc.h 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/drd_vc.h 2010-02-21 14:52:59 UTC (rev 11052)
@@ -39,7 +39,7 @@
* - Vector clocks are compared by comparing all counters of all threads.
* - When a thread synchronization action is performed that guarantees that
* new actions of the current thread are executed after the actions of the
- * other thread, the vector clock of the synchronization object and the
+ * other thread, the vector clock of the synchronization object and the
* current thread are combined (by taking the component-wise maximum).
* - A vector clock is incremented during actions such as
* pthread_create(), pthread_mutex_unlock(), sem_post(). (Actions where
Modified: trunk/drd/tests/annotate_ignore_rw.c
===================================================================
--- trunk/drd/tests/annotate_ignore_rw.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/annotate_ignore_rw.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -26,7 +26,7 @@
int ign_rw = 1;
int tmp;
pthread_t tid;
-
+
while ((optchar = getopt(argc, argv, "r")) != EOF)
{
switch (optchar)
Modified: trunk/drd/tests/annotate_ignore_write.c
===================================================================
--- trunk/drd/tests/annotate_ignore_write.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/annotate_ignore_write.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -25,7 +25,7 @@
int optchar;
int ign_rw = 1;
pthread_t tid;
-
+
while ((optchar = getopt(argc, argv, "r")) != EOF)
{
switch (optchar)
Modified: trunk/drd/tests/custom_alloc.c
===================================================================
--- trunk/drd/tests/custom_alloc.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/custom_alloc.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -33,14 +33,14 @@
if (hp + size2 > hp_lim) {
hp = get_superblock();
hp_lim = hp + SUPERBLOCK_SIZE - 1;
- }
+ }
p = hp + RZ;
hp += size2;
VALGRIND_MALLOCLIKE_BLOCK( p, size, RZ, /*is_zeroed*/1 );
return (void*)p;
-}
+}
static void custom_free(void* p)
{
@@ -85,6 +85,6 @@
// unfortunately not identified as being in a free'd
// block because the freeing of the block and shadow
// chunk isn't postponed.
-
+
// leak from make_leak()
}
Modified: trunk/drd/tests/fp_race.c
===================================================================
--- trunk/drd/tests/fp_race.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/fp_race.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -55,7 +55,7 @@
pthread_mutex_init(&s_mutex, 0);
/*
- * Switch to line-buffered mode, such that timing information can be
+ * Switch to line-buffered mode, such that timing information can be
* obtained for each printf() call with strace.
*/
setlinebuf(stdout);
Modified: trunk/drd/tests/matinv.c
===================================================================
--- trunk/drd/tests/matinv.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/matinv.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -161,7 +161,7 @@
/** Apply the Gauss-Jordan elimination algorithm on the matrix p->a starting
* at row r0 and up to but not including row r1. It is assumed that as many
- * threads execute this function concurrently as the count barrier p->b was
+ * threads execute this function concurrently as the count barrier p->b was
* initialized with. If the matrix p->a is nonsingular, and if matrix p->a
* has at least as many columns as rows, the result of this algorithm is that
* submatrix p->a[0..p->rows-1,0..p->rows-1] is the identity matrix.
Modified: trunk/drd/tests/omp_matinv.c
===================================================================
--- trunk/drd/tests/omp_matinv.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/omp_matinv.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -149,7 +149,7 @@
/** Apply the Gauss-Jordan elimination algorithm on the matrix p->a starting
* at row r0 and up to but not including row r1. It is assumed that as many
- * threads execute this function concurrently as the count barrier p->b was
+ * threads execute this function concurrently as the count barrier p->b was
* initialized with. If the matrix p->a is nonsingular, and if matrix p->a
* has at least as many columns as rows, the result of this algorithm is that
* submatrix p->a[0..p->rows-1,0..p->rows-1] is the identity matrix.
Modified: trunk/drd/tests/pth_broadcast.c
===================================================================
--- trunk/drd/tests/pth_broadcast.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/pth_broadcast.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -1,4 +1,4 @@
-/** Broadcast a (POSIX threads) signal to all running threads, where the
+/** Broadcast a (POSIX threads) signal to all running threads, where the
* number of threads can be specified on the command line. This test program
* is intended not only to test the correctness of drd but also to test
* whether performance does not degrade too much when the number of threads
@@ -96,7 +96,7 @@
printf("thread %d [%d] (1)\n", thread_info->m_threadnum, i);
}
csema_v(thread_info->m_sema);
-
+
// Wait until the main thread signals us via pthread_cond_broadcast().
pthread_cond_wait(&s_cond, &s_mutex);
if (s_trace)
Modified: trunk/drd/tests/pth_detached.c
===================================================================
--- trunk/drd/tests/pth_detached.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/pth_detached.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -56,13 +56,13 @@
thread_arg[i] = i;
pthread_mutex_init(&s_mutex, 0);
-
+
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
assert(pthread_attr_getdetachstate(&attr, &detachstate) == 0);
assert(detachstate == PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize(&attr, 16384);
- // Create count1 detached threads by setting the "detached" property via
+ // Create count1 detached threads by setting the "detached" property via
// thread attributes.
for (i = 0; i < count1; i++)
{
Modified: trunk/drd/tests/pth_detached_sem.c
===================================================================
--- trunk/drd/tests/pth_detached_sem.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/pth_detached_sem.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -51,13 +51,13 @@
thread_arg[i] = i;
sem_init(&s_sem, 0, 0);
-
+
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
assert(pthread_attr_getdetachstate(&attr, &detachstate) == 0);
assert(detachstate == PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize(&attr, 16384);
- // Create count1 detached threads by setting the "detached" property via
+ // Create count1 detached threads by setting the "detached" property via
// thread attributes.
for (i = 0; i < count1; i++)
{
Modified: trunk/drd/tests/sem_as_mutex.c
===================================================================
--- trunk/drd/tests/sem_as_mutex.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/sem_as_mutex.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -56,7 +56,7 @@
sem_init(&s_sem, 0, 1);
/*
- * Switch to line-buffered mode, such that timing information can be
+ * Switch to line-buffered mode, such that timing information can be
* obtained for each printf() call with strace.
*/
setlinebuf(stdout);
Modified: trunk/drd/tests/sem_open.c
===================================================================
--- trunk/drd/tests/sem_open.c 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/sem_open.c 2010-02-21 14:52:59 UTC (rev 11052)
@@ -68,7 +68,7 @@
}
/*
- * Switch to line-buffered mode, such that timing information can be
+ * Switch to line-buffered mode, such that timing information can be
* obtained for each printf() call with strace.
*/
setlinebuf(stdout);
Modified: trunk/drd/tests/tsan_thread_wrappers_pthread.h
===================================================================
--- trunk/drd/tests/tsan_thread_wrappers_pthread.h 2010-02-19 16:50:45 UTC (rev 11051)
+++ trunk/drd/tests/tsan_thread_wrappers_pthread.h 2010-02-21 14:52:59 UTC (rev 11052)
@@ -3,7 +3,7 @@
framework.
Copyright (C) 2008-2008 Google Inc
- ope...@go...
+ ope...@go...
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -23,22 +23,22 @@
The GNU General Public License is contained in the file COPYING.
*/
-// Author: Konstantin Serebryany <ope...@go...>
+// Author: Konstantin Serebryany <ope...@go...>
//
-// Here we define few simple classes that wrap pthread primitives.
+// Here we define few simple classes that wrap pthread primitives.
//
-// We need this to create unit tests for helgrind (or similar tool)
-// that will work with different threading frameworks.
+// We need this to create unit tests for helgrind (or similar tool)
+// that will work with different threading frameworks.
//
-// If one needs to test helgrind's support for another threading library,
-// he/she can create a copy of this file and replace pthread_ calls
-// with appropriate calls to his/her library.
+// If one needs to test helgrind's support for another threading library,
+// he/she can create a copy of this file and replace pthread_ calls
+// with appropriate calls to his/her library.
//
-// Note, that some of the methods defined here are annotated with
-// ANNOTATE_* macros defined in dynamic_annotations.h.
+// Note, that some of the methods defined here are annotated with
+// ANNOTATE_* macros defined in dynamic_annotations.h.
//
-// DISCLAIMER: the classes defined in this header file
-// are NOT intended for general use -- only for unit tests.
+// DISCLAIMER: the classes defined in this header file
+// are NOT intended for general use -- only for unit tests.
//
#ifndef THREAD_WRAPPERS_PTHREAD_H
@@ -71,23 +71,23 @@
#include <assert.h>
#ifdef NDEBUG
# error "Pleeease, do not define NDEBUG"
-#endif
+#endif
#define CHECK assert
/// Set this to true if malloc() uses mutex on your platform as this may
/// introduce a happens-before arc for a pure happens-before race detector.
const bool kMallocUsesMutex = false;
-/// Current time in milliseconds.
+/// Current time in milliseconds.
static inline int64_t GetCurrentTimeMillis() {
struct timeval now;
gettimeofday(&now, NULL);
return now.tv_sec * 1000 + now.tv_usec / 1000;
}
-/// Copy tv to ts adding offset in milliseconds.
-static inline void timeval2timespec(timeval *const tv,
- timespec *ts,
+/// Copy tv to ts adding offset in milliseconds.
+static inline void timeval2timespec(timeval *const tv,
+ timespec *ts,
int64_t offset_milli) {
const int64_t ten_9 = 1000000000LL;
const int64_t ten_6 = 1000000LL;
@@ -154,16 +154,16 @@
#endif // NO_SPINLOCK
-/// Just a boolean condition. Used by Mutex::LockWhen and similar.
+/// Just a boolean condition. Used by Mutex::LockWhen and similar.
class Condition {
public:
typedef bool (*func_t)(void*);
template <typename T>
- Condition(bool (*func)(T*), T* arg)
+ Condition(bool (*func)(T*), T* arg)
: func_(reinterpret_cast<func_t>(func)), arg_(arg) {}
- Condition(bool (*func)())
+ Condition(bool (*func)())
: func_(reinterpret_cast<func_t>(func)), arg_(NULL) {}
bool Eval() { return func_(arg_); }
@@ -176,22 +176,22 @@
/// Wrapper for pthread_mutex_t.
///
-/// pthread_mutex_t is *not* a reader-writer lock,
-/// so the methods like ReaderLock() aren't really reader locks.
-/// We can not use pthread_rwlock_t because it
+/// pthread_mutex_t is *not* a reader-writer lock,
+/// so the methods like ReaderLock() aren't really reader locks.
+/// We can not use pthread_rwlock_t because it
/// does not work with pthread_cond_t.
-///
-/// TODO: We still need to test reader locks with this class.
-/// Implement a mode where pthread_rwlock_t will be used
-/// instead of pthread_mutex_t (only when not used with CondVar or LockWhen).
-///
+///
+/// TODO: We still need to test reader locks with this class.
+/// Implement a mode where pthread_rwlock_t will be used
+/// instead of pthread_mutex_t (only when not used with CondVar or LockWhen).
+///
class Mutex {
friend class CondVar;
- public:
+ public:
Mutex() {
CHECK(0 == pthread_mutex_init(&mu_, NULL));
CHECK(0 == pthread_cond_init(&cv_, NULL));
- signal_at_unlock_ = true; // Always signal at Unlock to make
+ signal_at_unlock_ = true; // Always signal at Unlock to make
// Mutex more friendly to hybrid detectors.
}
~Mutex() {
@@ -202,7 +202,7 @@
bool TryLock() { return (0 == pthread_mutex_trylock(&mu_));}
void Unlock() {
if (signal_at_unlock_) {
- CHECK(0 == pthread_cond_signal(&cv_));
+ CHECK(0 == pthread_cond_signal(&cv_));
}
CHECK(0 == pthread_mutex_unlock(&mu_));
}
@@ -214,11 +214,11 @@
void ReaderLockWhen(Condition cond) { Lock(); WaitLoop(cond); }
void Await(Condition cond) { WaitLoop(cond); }
- bool ReaderLockWhenWithTimeout(Condition cond, int millis)
+ bool ReaderLockWhenWithTimeout(Condition cond, int millis)
{ Lock(); return WaitLoopWithTimeout(cond, millis); }
- bool LockWhenWithTimeout(Condition cond, int millis)
+ bool LockWhenWithTimeout(Condition cond, int millis)
{ Lock(); return WaitLoopWithTimeout(cond, millis); }
- bool AwaitWithTimeout(Condition cond, int millis)
+ bool AwaitWithTimeout(Condition cond, int millis)
{ return WaitLoopWithTimeout(cond, millis); }
private:
@@ -248,10 +248,10 @@
return cond.Eval();
}
- // A hack. cv_ should be the first data member so that
- // ANNOTATE_CONDVAR_WAIT(&MU, &MU) and ANNOTATE_CONDVAR_SIGNAL(&MU) works.
+ // A hack. cv_ should be the first data member so that
+ // ANNOTATE_CONDVAR_WAIT(&MU, &MU) and ANNOTATE_CONDVAR_SIGNAL(&MU) works.
// (See also racecheck_unittest.cc)
- pthread_cond_t cv_;
+ pthread_cond_t cv_;
pthread_mutex_t mu_;
bool signal_at_unlock_; // Set to true if Wait was called.
};
@@ -259,7 +259,7 @@
class MutexLock { // Scoped Mutex Locker/Unlocker
public:
- MutexLock(Mutex *mu)
+ MutexLock(Mutex *mu)
: mu_(mu) {
mu_->Lock();
}
@@ -271,13 +271,13 @@
};
-/// Wrapper for pthread_cond_t.
+/// Wrapper for pthread_cond_t.
class CondVar {
public:
CondVar() { CHECK(0 == pthread_cond_init(&cv_, NULL)); }
~CondVar() { CHECK(0 == pthread_cond_destroy(&cv_)); }
void Wait(Mutex *mu) { CHECK(0 == pthread_cond_wait(&cv_, &mu->mu_)); }
- bool WaitWithTimeout(Mutex *mu, int millis) {
+ bool WaitWithTimeout(Mutex *mu, int millis) {
struct timeval now;
struct timespec timeout;
gettimeofday(&now, NULL);
@@ -293,7 +293,7 @@
// pthreads do not allow to use condvar with rwlock so we can't make
// ReaderLock method of Mutex to be the real rw-lock.
-// So, we need a special lock class to test reader locks.
+// So, we need a special lock class to test reader locks.
#define NEEDS_SEPERATE_RW_LOCK
class RWLock {
public:
@@ -310,7 +310,7 @@
class ReaderLockScoped { // Scoped RWLock Locker/Unlocker
public:
- ReaderLockScoped(RWLock *mu)
+ ReaderLockScoped(RWLock *mu)
: mu_(mu) {
mu_->ReaderLock();
}
@@ -323,7 +323,7 @@
class WriterLockScoped { // Scoped RWLock Locker/Unlocker
public:
- WriterLockScoped(RWLock *mu)
+ WriterLockScoped(RWLock *mu)
: mu_(mu) {
mu_->Lock();
}
@@ -339,14 +339,14 @@
/// Wrapper for pthread_create()/pthread_join().
class MyThread {
- public:
+ public:
typedef void *(*worker_t)(void*);
- MyThread(worker_t worker, void *arg = NULL, const char *name = NULL)
+ 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)
+ MyThread(void (*worker)(void), void *arg = NULL, const char *name = NULL)
:w_(reinterpret_cast<worker_t>(worker)), arg_(arg), name_(name) {}
- MyThread(void (*worker)(void *), void *arg = NULL, const char *name = NULL)
+ MyThread(void (*worker)(void *), void *arg = NULL, const char *name = NULL)
:w_(reinterpret_cast<worker_t>(worker)), arg_(arg), name_(name) {}
~MyThread(){ w_ = NULL; arg_ = NULL;}
@@ -378,7 +378,7 @@
//ANNOTATE_PCQ_DESTROY(this);
}
- // Put.
+ // Put.
void Put(void *item) {
mu_.Lock();
q_.push(item);
@@ -387,18 +387,18 @@
mu_.Unlock();
}
- // Get.
- // Blocks if the queue is empty.
- void *Get() {
+ // Get.
+ // Blocks if the queue is empty.
+ void *Get() {
mu_.LockWhen(Condition(IsQueueNotEmpty, &q_));
void * item = NULL;
bool ok = TryGetInternal(&item);
- CHECK(ok);
+ CHECK(ok);
mu_.Unlock();
return item;
}
- // If queue is not empty,
+ // If queue is not empty,
// remove an element from queue, put it into *res and return true.
// Otherwise return false.
bool TryGet(void **res) {
@@ -411,9 +411,9 @@
private:
Mutex mu_;
std::queue<void*> q_; // protected by mu_
-
+
// Requires mu_
- bool TryGetInternal(void ** item_ptr) {
+ bool TryGetInternal(void ** item_ptr) {
if (q_.empty())
return false;
*item_ptr = q_.front();
@@ -421,7 +421,7 @@
//ANNOTATE_PCQ_GET(this);
return true;
}
-
+
static bool IsQueueNotEmpty(std::queue<void*> * queue) {
return !queue->empty();
}
@@ -429,15 +429,15 @@
-/// Function pointer with zero, one or two parameters.
+/// Function pointer with zero, one or two parameters.
struct Closure {
typedef void (*F0)();
typedef void (*F1)(void *arg1);
typedef void (*F2)(void *arg1, void *arg2);
- int n_params;
- void *f;
- void *param1;
- void *param2;
+ int n_params;
+ void *f;
+ void *param1;
+ void *param2;
void Execute() {
if (n_params == 0) {
@@ -450,7 +450,7 @@
}
delete this;
}
-};
+};
Closure *NewCallback(void (*f)()) {
Closure *res = new Closure;
@@ -483,24 +483,24 @@
return res;
}
-/*! A thread pool that uses ProducerConsumerQueue.
- Usage:
+/*! A thread pool that uses ProducerConsumerQueue.
+ Usage:
{
ThreadPool pool(n_workers);
pool.StartWorkers();
pool.Add(NewCallback(func_with_no_args));
pool.Add(NewCallback(func_with_one_arg, arg));
pool.Add(NewCallback(func_with_two_args, arg1, arg2));
- ... // more calls to pool.Add()
-
- // the ~ThreadPool() is called: we wait workers to finish
- // and then join all threads in the pool.
+ ... // more calls to pool.Add()
+
+ // the ~ThreadPool() is called: we wait workers to finish
+ // and then join all threads in the pool.
}
*/
class ThreadPool {
- public:
- //! Create n_threads threads, but do not start.
- explicit ThreadPool(int n_threads)
+ public:
+ //! Create n_threads threads, but do not start.
+ explicit ThreadPool(int n_threads)
: queue_(INT_MAX) {
for (int i = 0; i < n_threads; i++) {
MyThread *thread = new MyThread(&ThreadPool::Worker, this);
@@ -508,14 +508,14 @@
}
}
- //! Start all threads.
+ //! Start all threads.
void StartWorkers() {
for (size_t i = 0; i < workers_.size(); i++) {
workers_[i]->Start();
}
}
- //! Add a closure.
+ //! Add a closure.
void Add(Closure *closure) {
queue_.Put(closure);
}
@@ -541,22 +541,22 @@
while (true) {
Closure *closure = reinterpret_cast<Closure*>(pool->queue_.Get());
if(closure == NULL) {
- return NULL;
+ return NULL;
}
- closure->Execute();
+ closure->Execute();
}
}
};
#ifndef NO_BARRIER
-/// Wrapper for pthread_barrier_t.
+/// Wrapper for pthread_barrier_t.
class Barrier{
public:
explicit Barrier(int n_threads) {CHECK(0 == pthread_barrier_init(&b_, 0, n_threads));}
~Barrier() {CHECK(0 == pthread_barrier_destroy(&b_));}
void Block() {
// helgrind 3.3.0 does not have an interceptor for barrier.
- // but our current local version does.
+ // but our current local version does.
// ANNOTATE_CONDVAR_SIGNAL(this);
pthread_barrier_wait(&b_);
// ANNOTATE_CONDVAR_WAIT(this, this);
|