Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovs-thread: Avoid pthread_rwlockattr_t on Windows.
A recent commit fixed ovs_rwlock_init() to pass the pthread_rwlockattr_t that it initialized to pthread_rwlock_init(). According to POSIX documentation this is correct, but on Windows the current implementation of pthreads does not support a pre-initialized attribute. Please see a fork of the implementation https://github.com/GerHobbelt/pthread-win32/blob/19fd5054b29af1b4e3b3278bfffbb6274c6c89f5/pthread_rwlock_init.c#L59-L63 This is the same implementation as the official version found under: ftp://sourceware.org/pub/pthreads-win32/) A short debug output from `vswitch` to confirm the above: >k Index Function -------------------------------------------------------------------------------- *1 ovs-vswitchd.exe!ovs_rwlock_init(const ovs_rwlock * l_=0x000001721c7da250) 2 ovs-vswitchd.exe!open_dpif_backer(const char * type=0x000001721c7d8d60, dpif_backer * * backerp=0x000001721c7d89c0) 3 ovs-vswitchd.exe!construct(ofproto * ofproto_=0x000001721c7d87d0) 4 ovs-vswitchd.exe!ofproto_create(const char * datapath_name=0x000001721c7d86e0, const char * datapath_type=0x000001721c7d8750, ofproto * * ofprotop=0x000001721c7d80b8) 5 ovs-vswitchd.exe!bridge_reconfigure(const ovsrec_open_vswitch * ovs_cfg=0x000001721c7e05b0) 6 ovs-vswitchd.exe!bridge_run() 7 ovs-vswitchd.exe!main(int argc=6, char * * argv=0x000001721c729e10) 8 [External Code] >? error 22 https://github.com/openvswitch/ovs/blob/master/lib/ovs-thread.c#L243 This patch is critical because the majority (over 800) of the unit tests are failing. Fixes: 1a15f39 ("lib/ovs-thread: set prefer writer lock for ovs_rwlock_init()") Signed-off-by: Alin Gabriel Serdean <[email protected]> Acked-by: Shashank Ram <[email protected]> [[email protected] changed the details of the approach] Signed-off-by: Ben Pfaff <[email protected]>
- Loading branch information