winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2015
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
503 discussions
Start a n
N
ew thread
Francois Gouget : vcomp/tests: Make my_for_static_init() static.
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: 7734de65c776a6f8f1160e60cd08c809a20364d7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7734de65c776a6f8f1160e60c…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Aug 7 11:54:33 2015 +0200 vcomp/tests: Make my_for_static_init() static. --- dlls/vcomp/tests/vcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index 26b50a7..f24c654 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -696,7 +696,7 @@ static void test_vcomp_for_static_simple_init(void) #define VCOMP_FOR_STATIC_BROKEN_LOOP 1 #define VCOMP_FOR_STATIC_BROKEN_NEXT 2 -DWORD CDECL my_for_static_init(int first, int last, int step, int chunksize, unsigned int *loops, +static DWORD CDECL my_for_static_init(int first, int last, int step, int chunksize, unsigned int *loops, int *begin, int *end, int *next, int *lastchunk) { unsigned int iterations, num_chunks, per_thread, remaining;
1
0
0
0
Francois Gouget : d3drm: Fix a trailing '\n' in a TRACE().
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: 7e1e3a4d6d79ed08e770cb8c4b855ef163319ee5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7e1e3a4d6d79ed08e770cb8c4…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Aug 7 11:53:32 2015 +0200 d3drm: Fix a trailing '\n' in a TRACE(). --- dlls/d3drm/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/d3drm/device.c b/dlls/d3drm/device.c index 9c0fe4a..aebba9a 100644 --- a/dlls/d3drm/device.c +++ b/dlls/d3drm/device.c @@ -636,7 +636,7 @@ static DWORD WINAPI d3drm_device2_GetShades(IDirect3DRMDevice2 *iface) { struct d3drm_device *device = impl_from_IDirect3DRMDevice2(iface); - TRACE("iface %p.\n.", iface); + TRACE("iface %p.\n", iface); return IDirect3DRMDevice3_GetShades(&device->IDirect3DRMDevice3_iface); }
1
0
0
0
Francois Gouget : ntdll: Use #ifdef to check for potentially undefined macros.
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: 93a7845ae8d7a9813f59d3020c05c0917be39d3c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=93a7845ae8d7a9813f59d3020…
Author: Francois Gouget <fgouget(a)free.fr> Date: Fri Aug 7 11:52:58 2015 +0200 ntdll: Use #ifdef to check for potentially undefined macros. --- dlls/ntdll/signal_x86_64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/signal_x86_64.c b/dlls/ntdll/signal_x86_64.c index 9b98894..575a770 100644 --- a/dlls/ntdll/signal_x86_64.c +++ b/dlls/ntdll/signal_x86_64.c @@ -1431,7 +1431,7 @@ static NTSTATUS dwarf_virtual_unwind( ULONG64 ip, ULONG64 *frame,CONTEXT *contex } -#if HAVE_LIBUNWIND_H +#ifdef HAVE_LIBUNWIND_H /*********************************************************************** * libunwind_set_cursor_from_context */ @@ -2341,7 +2341,7 @@ static NTSTATUS call_stack_handlers( EXCEPTION_RECORD *rec, CONTEXT *orig_contex if (status != STATUS_SUCCESS) return status; got_info = TRUE; } -#if HAVE_LIBUNWIND_H +#ifdef HAVE_LIBUNWIND_H else { status = libunwind_virtual_unwind( context.Rip, &got_info, &dispatch.EstablisherFrame, &new_context, @@ -3369,7 +3369,7 @@ void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec if (status != STATUS_SUCCESS) raise_status( status, rec ); got_info = TRUE; } -#if HAVE_LIBUNWIND_H +#ifdef HAVE_LIBUNWIND_H else { status = libunwind_virtual_unwind( context->Rip, &got_info, &dispatch.EstablisherFrame, &new_context,
1
0
0
0
Henri Verbeet : dxgi: Implement dxgi_swapchain_ResizeBuffers().
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: fca2d194236fe35a663bba3d2d6b9414745b081b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fca2d194236fe35a663bba3d2…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Aug 7 10:01:34 2015 +0200 dxgi: Implement dxgi_swapchain_ResizeBuffers(). --- dlls/dxgi/swapchain.c | 34 ++++- dlls/dxgi/tests/device.c | 305 +++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/swapchain.c | 2 +- dlls/wined3d/wined3d.spec | 1 + dlls/wined3d/wined3d_private.h | 3 - include/wine/wined3d.h | 3 + 6 files changed, 342 insertions(+), 6 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=fca2d194236fe35a663bb…
1
0
0
0
Henri Verbeet : wined3d: Introduce a separate function to resize swapchain buffers.
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: 2735947d763df9bb46bffde760be9446463da668 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2735947d763df9bb46bffde76…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Aug 7 10:01:33 2015 +0200 wined3d: Introduce a separate function to resize swapchain buffers. --- dlls/wined3d/device.c | 202 ++++++++++++----------------------------- dlls/wined3d/swapchain.c | 94 ++++++++++++++++++- dlls/wined3d/wined3d_private.h | 4 +- 3 files changed, 155 insertions(+), 145 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=2735947d763df9bb46bff…
1
0
0
0
Sebastian Lackner : vcomp/tests: Add tests for _vcomp_enter_critsect and _vcomp_leave_critsect.
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: 7fd7bcf00e940a5d3e7ed2d24ba69a384997bf0b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7fd7bcf00e940a5d3e7ed2d24…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Aug 7 08:23:18 2015 +0200 vcomp/tests: Add tests for _vcomp_enter_critsect and _vcomp_leave_critsect. --- dlls/vcomp/tests/vcomp.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index e5617d8..26b50a7 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -51,6 +51,7 @@ static void (CDECL *p_vcomp_atomic_sub_r4)(float *dest, float val); static void (CDECL *p_vcomp_atomic_sub_r8)(double *dest, double val); static void (CDECL *p_vcomp_atomic_xor_i4)(int *dest, int val); static void (CDECL *p_vcomp_barrier)(void); +static void (CDECL *p_vcomp_enter_critsect)(CRITICAL_SECTION **critsect); static void (CDECL *p_vcomp_for_dynamic_init)(unsigned int flags, unsigned int first, unsigned int last, int step, unsigned int chunksize); static int (CDECL *p_vcomp_for_dynamic_next)(unsigned int *begin, unsigned int *end); @@ -60,6 +61,7 @@ static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, i static void (CDECL *p_vcomp_for_static_simple_init)(unsigned int first, unsigned int last, int step, BOOL increment, unsigned int *begin, unsigned int *end); static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...); +static void (CDECL *p_vcomp_leave_critsect)(CRITICAL_SECTION *critsect); static int (CDECL *p_vcomp_master_begin)(void); static void (CDECL *p_vcomp_master_end)(void); static void (CDECL *p_vcomp_sections_init)(int n); @@ -226,12 +228,14 @@ static BOOL init_vcomp(void) VCOMP_GET_PROC(_vcomp_atomic_sub_r8); VCOMP_GET_PROC(_vcomp_atomic_xor_i4); VCOMP_GET_PROC(_vcomp_barrier); + VCOMP_GET_PROC(_vcomp_enter_critsect); VCOMP_GET_PROC(_vcomp_for_dynamic_init); VCOMP_GET_PROC(_vcomp_for_dynamic_next); VCOMP_GET_PROC(_vcomp_for_static_end); VCOMP_GET_PROC(_vcomp_for_static_init); VCOMP_GET_PROC(_vcomp_for_static_simple_init); VCOMP_GET_PROC(_vcomp_fork); + VCOMP_GET_PROC(_vcomp_leave_critsect); VCOMP_GET_PROC(_vcomp_master_begin); VCOMP_GET_PROC(_vcomp_master_end); VCOMP_GET_PROC(_vcomp_sections_init); @@ -1219,6 +1223,52 @@ static void test_vcomp_single_begin(void) pomp_set_num_threads(max_threads); } +static void CDECL critsect_cb(LONG *a) +{ + static CRITICAL_SECTION *critsect; + LONG tmp; + + p_vcomp_enter_critsect(&critsect); + tmp = *a; + Sleep(50); + *a = tmp + 1; + p_vcomp_leave_critsect(critsect); + + ok(critsect != NULL, "expected critsect != NULL\n"); + + EnterCriticalSection(critsect); + tmp = *a; + Sleep(50); + *a = tmp + 1; + LeaveCriticalSection(critsect); +} + +static void test_vcomp_enter_critsect(void) +{ + int max_threads = pomp_get_max_threads(); + LONG a; + int i; + + a = 0; + critsect_cb(&a); + ok(a == 2, "expected a == 2, got %d\n", a); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + + a = 0; + p_vcomp_fork(TRUE, 1, critsect_cb, &a); + ok(a == 2 * i, "expected a == %d, got %d\n", 2 * i, a); + + a = 0; + p_vcomp_fork(FALSE, 1, critsect_cb, &a); + ok(a == 2, "expected a == 2, got %d\n", a); + } + + pomp_set_num_threads(max_threads); +} + static void test_atomic_integer32(void) { struct @@ -1337,6 +1387,7 @@ START_TEST(vcomp) test_vcomp_for_dynamic_init(); test_vcomp_master_begin(); test_vcomp_single_begin(); + test_vcomp_enter_critsect(); test_atomic_integer32(); test_atomic_float(); test_atomic_double();
1
0
0
0
Sebastian Lackner : vcomp: Implement _vcomp_enter_critsect and _vcomp_leave_critsect.
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: b0e4fd05e57100ce8d2275560eefb9a9d83ccef9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b0e4fd05e57100ce8d2275560…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Aug 7 08:22:51 2015 +0200 vcomp: Implement _vcomp_enter_critsect and _vcomp_leave_critsect. --- dlls/vcomp/main.c | 34 ++++++++++++++++++++++++++++++++++ dlls/vcomp/vcomp.spec | 4 ++-- dlls/vcomp100/vcomp100.spec | 4 ++-- dlls/vcomp110/vcomp110.spec | 4 ++-- dlls/vcomp90/vcomp90.spec | 4 ++-- 5 files changed, 42 insertions(+), 8 deletions(-) diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 1d9765f..10ac465 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -979,6 +979,40 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) __ms_va_end(team_data.valist); } +void CDECL _vcomp_enter_critsect(CRITICAL_SECTION **critsect) +{ + TRACE("(%p)\n", critsect); + + if (!*critsect) + { + CRITICAL_SECTION *new_critsect; + if (!(new_critsect = HeapAlloc(GetProcessHeap(), 0, sizeof(*new_critsect)))) + { + ERR("could not allocate critical section\n"); + ExitProcess(1); + } + + InitializeCriticalSection(new_critsect); + new_critsect->DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": critsect"); + + if (interlocked_cmpxchg_ptr((void **)critsect, new_critsect, NULL) != NULL) + { + /* someone beat us to it */ + new_critsect->DebugInfo->Spare[0] = 0; + DeleteCriticalSection(new_critsect); + HeapFree(GetProcessHeap(), 0, new_critsect); + } + } + + EnterCriticalSection(*critsect); +} + +void CDECL _vcomp_leave_critsect(CRITICAL_SECTION *critsect) +{ + TRACE("(%p)\n", critsect); + LeaveCriticalSection(critsect); +} + BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) { TRACE("(%p, %d, %p)\n", instance, reason, reserved); diff --git a/dlls/vcomp/vcomp.spec b/dlls/vcomp/vcomp.spec index 3167839..55b699f 100644 --- a/dlls/vcomp/vcomp.spec +++ b/dlls/vcomp/vcomp.spec @@ -53,7 +53,7 @@ @ cdecl _vcomp_barrier() @ stub _vcomp_copyprivate_broadcast @ stub _vcomp_copyprivate_receive -@ stub _vcomp_enter_critsect +@ cdecl _vcomp_enter_critsect(ptr) @ stub _vcomp_flush @ cdecl _vcomp_for_dynamic_init(long long long long long) @ stub _vcomp_for_dynamic_init_i8 @@ -66,7 +66,7 @@ @ stub _vcomp_for_static_simple_init_i8 @ varargs _vcomp_fork(long long ptr) @ stub _vcomp_get_thread_num -@ stub _vcomp_leave_critsect +@ cdecl _vcomp_leave_critsect(ptr) @ stub _vcomp_master_barrier @ cdecl _vcomp_master_begin() @ cdecl _vcomp_master_end() diff --git a/dlls/vcomp100/vcomp100.spec b/dlls/vcomp100/vcomp100.spec index 38578b9..7bf6238 100644 --- a/dlls/vcomp100/vcomp100.spec +++ b/dlls/vcomp100/vcomp100.spec @@ -53,7 +53,7 @@ @ cdecl _vcomp_barrier() vcomp._vcomp_barrier @ stub _vcomp_copyprivate_broadcast @ stub _vcomp_copyprivate_receive -@ stub _vcomp_enter_critsect +@ cdecl _vcomp_enter_critsect(ptr) vcomp._vcomp_enter_critsect @ stub _vcomp_flush @ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init @ stub _vcomp_for_dynamic_init_i8 @@ -66,7 +66,7 @@ @ stub _vcomp_for_static_simple_init_i8 @ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork @ stub _vcomp_get_thread_num -@ stub _vcomp_leave_critsect +@ cdecl _vcomp_leave_critsect(ptr) vcomp._vcomp_leave_critsect @ stub _vcomp_master_barrier @ cdecl _vcomp_master_begin() vcomp._vcomp_master_begin @ cdecl _vcomp_master_end() vcomp._vcomp_master_end diff --git a/dlls/vcomp110/vcomp110.spec b/dlls/vcomp110/vcomp110.spec index ef8222f..c84e44c 100644 --- a/dlls/vcomp110/vcomp110.spec +++ b/dlls/vcomp110/vcomp110.spec @@ -54,7 +54,7 @@ @ cdecl _vcomp_barrier() vcomp._vcomp_barrier @ stub _vcomp_copyprivate_broadcast @ stub _vcomp_copyprivate_receive -@ stub _vcomp_enter_critsect +@ cdecl _vcomp_enter_critsect(ptr) vcomp._vcomp_enter_critsect @ stub _vcomp_flush @ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init @ stub _vcomp_for_dynamic_init_i8 @@ -67,7 +67,7 @@ @ stub _vcomp_for_static_simple_init_i8 @ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork @ stub _vcomp_get_thread_num -@ stub _vcomp_leave_critsect +@ cdecl _vcomp_leave_critsect(ptr) vcomp._vcomp_leave_critsect @ stub _vcomp_master_barrier @ cdecl _vcomp_master_begin() vcomp._vcomp_master_begin @ cdecl _vcomp_master_end() vcomp._vcomp_master_end diff --git a/dlls/vcomp90/vcomp90.spec b/dlls/vcomp90/vcomp90.spec index 38578b9..7bf6238 100644 --- a/dlls/vcomp90/vcomp90.spec +++ b/dlls/vcomp90/vcomp90.spec @@ -53,7 +53,7 @@ @ cdecl _vcomp_barrier() vcomp._vcomp_barrier @ stub _vcomp_copyprivate_broadcast @ stub _vcomp_copyprivate_receive -@ stub _vcomp_enter_critsect +@ cdecl _vcomp_enter_critsect(ptr) vcomp._vcomp_enter_critsect @ stub _vcomp_flush @ cdecl _vcomp_for_dynamic_init(long long long long long) vcomp._vcomp_for_dynamic_init @ stub _vcomp_for_dynamic_init_i8 @@ -66,7 +66,7 @@ @ stub _vcomp_for_static_simple_init_i8 @ varargs _vcomp_fork(long long ptr) vcomp._vcomp_fork @ stub _vcomp_get_thread_num -@ stub _vcomp_leave_critsect +@ cdecl _vcomp_leave_critsect(ptr) vcomp._vcomp_leave_critsect @ stub _vcomp_master_barrier @ cdecl _vcomp_master_begin() vcomp._vcomp_master_begin @ cdecl _vcomp_master_end() vcomp._vcomp_master_end
1
0
0
0
Sebastian Lackner : vcomp/tests: Add tests for _vcomp_single_begin and _vcomp_single_end.
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: 89b383740cd48ff97b25e8bb5798ad58344d4388 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=89b383740cd48ff97b25e8bb5…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Aug 7 08:22:19 2015 +0200 vcomp/tests: Add tests for _vcomp_single_begin and _vcomp_single_end. Yes, its intentional that the call to p_vcomp_single_end() is after the if-block. Somehow MS made a difference here between the master and the single directive... --- dlls/vcomp/tests/vcomp.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index 99c98ef..e5617d8 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -65,6 +65,8 @@ static void (CDECL *p_vcomp_master_end)(void); static void (CDECL *p_vcomp_sections_init)(int n); static int (CDECL *p_vcomp_sections_next)(void); static void (CDECL *p_vcomp_set_num_threads)(int num_threads); +static int (CDECL *p_vcomp_single_begin)(int flags); +static void (CDECL *p_vcomp_single_end)(void); static int (CDECL *pomp_get_max_threads)(void); static int (CDECL *pomp_get_nested)(void); static int (CDECL *pomp_get_num_threads)(void); @@ -235,6 +237,8 @@ static BOOL init_vcomp(void) VCOMP_GET_PROC(_vcomp_sections_init); VCOMP_GET_PROC(_vcomp_sections_next); VCOMP_GET_PROC(_vcomp_set_num_threads); + VCOMP_GET_PROC(_vcomp_single_begin); + VCOMP_GET_PROC(_vcomp_single_end); VCOMP_GET_PROC(omp_get_max_threads); VCOMP_GET_PROC(omp_get_nested); VCOMP_GET_PROC(omp_get_num_threads); @@ -1168,6 +1172,53 @@ static void test_vcomp_master_begin(void) pomp_set_num_threads(max_threads); } +static void CDECL single_cb(int flags, HANDLE semaphore) +{ + int num_threads = pomp_get_num_threads(); + + if (p_vcomp_single_begin(flags)) + { + if (num_threads >= 2) + { + DWORD result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + } + } + p_vcomp_single_end(); + + if (p_vcomp_single_begin(flags)) + { + if (num_threads >= 2) + ReleaseSemaphore(semaphore, 1, NULL); + } + p_vcomp_single_end(); +} + +static void test_vcomp_single_begin(void) +{ + int max_threads = pomp_get_max_threads(); + HANDLE semaphore; + int i; + + semaphore = CreateSemaphoreA(NULL, 0, 1, NULL); + ok(semaphore != NULL, "CreateSemaphoreA failed %u\n", GetLastError()); + + single_cb(0, semaphore); + single_cb(1, semaphore); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + p_vcomp_fork(TRUE, 2, single_cb, 0, semaphore); + p_vcomp_fork(TRUE, 2, single_cb, 1, semaphore); + p_vcomp_fork(FALSE, 2, single_cb, 0, semaphore); + p_vcomp_fork(FALSE, 2, single_cb, 1, semaphore); + } + + CloseHandle(semaphore); + pomp_set_num_threads(max_threads); +} + static void test_atomic_integer32(void) { struct @@ -1285,6 +1336,7 @@ START_TEST(vcomp) test_vcomp_for_static_init(); test_vcomp_for_dynamic_init(); test_vcomp_master_begin(); + test_vcomp_single_begin(); test_atomic_integer32(); test_atomic_float(); test_atomic_double();
1
0
0
0
Sebastian Lackner : vcomp: Implement _vcomp_single_begin and _vcomp_single_end.
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: ea188ea0541e6c2dcf035ed547cef37d5e018a45 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ea188ea0541e6c2dcf035ed54…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Aug 7 08:21:36 2015 +0200 vcomp: Implement _vcomp_single_begin and _vcomp_single_end. --- dlls/vcomp/main.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/dlls/vcomp/main.c b/dlls/vcomp/main.c index 1e69e31..1d9765f 100644 --- a/dlls/vcomp/main.c +++ b/dlls/vcomp/main.c @@ -67,6 +67,9 @@ struct vcomp_thread_data struct list entry; CONDITION_VARIABLE cond; + /* single */ + unsigned int single; + /* section */ unsigned int section; @@ -95,6 +98,9 @@ struct vcomp_team_data struct vcomp_task_data { + /* single */ + unsigned int single; + /* section */ unsigned int section; int num_sections; @@ -218,6 +224,7 @@ static struct vcomp_thread_data *vcomp_init_thread_data(void) ExitProcess(1); } + data->task.single = 0; data->task.section = 0; data->task.dynamic = 0; @@ -227,6 +234,7 @@ static struct vcomp_thread_data *vcomp_init_thread_data(void) thread_data->thread_num = 0; thread_data->parallel = FALSE; thread_data->fork_threads = 0; + thread_data->single = 1; thread_data->section = 1; thread_data->dynamic = 1; thread_data->dynamic_type = 0; @@ -503,13 +511,28 @@ void CDECL _vcomp_master_end(void) int CDECL _vcomp_single_begin(int flags) { - TRACE("(%x): stub\n", flags); - return TRUE; + struct vcomp_thread_data *thread_data = vcomp_init_thread_data(); + struct vcomp_task_data *task_data = thread_data->task; + int ret = FALSE; + + TRACE("(%x): semi-stub\n", flags); + + EnterCriticalSection(&vcomp_section); + thread_data->single++; + if ((int)(thread_data->single - task_data->single) > 0) + { + task_data->single = thread_data->single; + ret = TRUE; + } + LeaveCriticalSection(&vcomp_section); + + return ret; } void CDECL _vcomp_single_end(void) { - TRACE("stub\n"); + TRACE("()\n"); + /* nothing to do here */ } void CDECL _vcomp_sections_init(int n) @@ -859,6 +882,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) team_data.barrier = 0; team_data.barrier_count = 0; + task_data.single = 0; task_data.section = 0; task_data.dynamic = 0; @@ -867,6 +891,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) thread_data.thread_num = 0; thread_data.parallel = ifval || prev_thread_data->parallel; thread_data.fork_threads = 0; + thread_data.single = 1; thread_data.section = 1; thread_data.dynamic = 1; thread_data.dynamic_type = 0; @@ -887,6 +912,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) data->thread_num = team_data.num_threads++; data->parallel = thread_data.parallel; data->fork_threads = 0; + data->single = 1; data->section = 1; data->dynamic = 1; data->dynamic_type = 0; @@ -910,6 +936,7 @@ void WINAPIV _vcomp_fork(BOOL ifval, int nargs, void *wrapper, ...) data->thread_num = team_data.num_threads; data->parallel = thread_data.parallel; data->fork_threads = 0; + data->single = 1; data->section = 1; data->dynamic = 1; data->dynamic_type = 0;
1
0
0
0
Sebastian Lackner : vcomp/tests: Add tests for _vcomp_master_begin and _vcomp_master_end.
by Alexandre Julliard
07 Aug '15
07 Aug '15
Module: wine Branch: master Commit: 0ff9a68af3fb1971253dc0c0af9508d82d5f5c90 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0ff9a68af3fb1971253dc0c0a…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Fri Aug 7 08:21:09 2015 +0200 vcomp/tests: Add tests for _vcomp_master_begin and _vcomp_master_end. --- dlls/vcomp/tests/vcomp.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dlls/vcomp/tests/vcomp.c b/dlls/vcomp/tests/vcomp.c index 5dbe166..99c98ef 100644 --- a/dlls/vcomp/tests/vcomp.c +++ b/dlls/vcomp/tests/vcomp.c @@ -60,6 +60,8 @@ static void (CDECL *p_vcomp_for_static_init)(int first, int last, int step, i static void (CDECL *p_vcomp_for_static_simple_init)(unsigned int first, unsigned int last, int step, BOOL increment, unsigned int *begin, unsigned int *end); static void (WINAPIV *p_vcomp_fork)(BOOL ifval, int nargs, void *wrapper, ...); +static int (CDECL *p_vcomp_master_begin)(void); +static void (CDECL *p_vcomp_master_end)(void); static void (CDECL *p_vcomp_sections_init)(int n); static int (CDECL *p_vcomp_sections_next)(void); static void (CDECL *p_vcomp_set_num_threads)(int num_threads); @@ -228,6 +230,8 @@ static BOOL init_vcomp(void) VCOMP_GET_PROC(_vcomp_for_static_init); VCOMP_GET_PROC(_vcomp_for_static_simple_init); VCOMP_GET_PROC(_vcomp_fork); + VCOMP_GET_PROC(_vcomp_master_begin); + VCOMP_GET_PROC(_vcomp_master_end); VCOMP_GET_PROC(_vcomp_sections_init); VCOMP_GET_PROC(_vcomp_sections_next); VCOMP_GET_PROC(_vcomp_set_num_threads); @@ -1122,6 +1126,48 @@ static void test_vcomp_for_dynamic_init(void) pomp_set_num_threads(max_threads); } +static void CDECL master_cb(HANDLE semaphore) +{ + int num_threads = pomp_get_num_threads(); + int thread_num = pomp_get_thread_num(); + + if (p_vcomp_master_begin()) + { + ok(thread_num == 0, "expected thread_num == 0, got %d\n", thread_num); + if (num_threads >= 2) + { + DWORD result = WaitForSingleObject(semaphore, 1000); + ok(result == WAIT_OBJECT_0, "WaitForSingleObject returned %u\n", result); + } + p_vcomp_master_end(); + } + + if (thread_num == 1) + ReleaseSemaphore(semaphore, 1, NULL); +} + +static void test_vcomp_master_begin(void) +{ + int max_threads = pomp_get_max_threads(); + HANDLE semaphore; + int i; + + semaphore = CreateSemaphoreA(NULL, 0, 1, NULL); + ok(semaphore != NULL, "CreateSemaphoreA failed %u\n", GetLastError()); + + master_cb(semaphore); + + for (i = 1; i <= 4; i++) + { + pomp_set_num_threads(i); + p_vcomp_fork(TRUE, 1, master_cb, semaphore); + p_vcomp_fork(FALSE, 1, master_cb, semaphore); + } + + CloseHandle(semaphore); + pomp_set_num_threads(max_threads); +} + static void test_atomic_integer32(void) { struct @@ -1238,6 +1284,7 @@ START_TEST(vcomp) test_vcomp_for_static_simple_init(); test_vcomp_for_static_init(); test_vcomp_for_dynamic_init(); + test_vcomp_master_begin(); test_atomic_integer32(); test_atomic_float(); test_atomic_double();
1
0
0
0
← Newer
1
...
38
39
40
41
42
43
44
...
51
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Results per page:
10
25
50
100
200