public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Yuri Sadykov <sadykov@gmail.com>
To: pthreads-win32@sourceware.org
Subject: Still fighting 64-bit
Date: Fri, 25 Feb 2011 21:37:00 -0000	[thread overview]
Message-ID: <AANLkTikzCNuvbzZH2fMyqCG0LupL+ePYHqwrKm0Sy-nR@mail.gmail.com> (raw)

Guys,

I still unclear of 64-bit support of current pthread inmlementation on Windows.
I use Visual Studio 2008 to produce native 64-bit executable.
I got pthread sources from top of cvs repository and build the
library. I read somewhere that static lib is not good for some
reasons, so I build DLL. But I have problem with
pthread_cond_destroy(), program crashes on that call.
pthread_cond_destroy() calls pthread_mutex_trylock(), which tries to
call by zero pointer. ptw32_interlocked_compare_exchange should point
to actual function but it is NULL pointer.

  if (0 == (LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE (
		     (PTW32_INTERLOCKED_LPLONG) &mx->lock_idx,
		     (PTW32_INTERLOCKED_LONG) 1,
		     (PTW32_INTERLOCKED_LONG) 0))

Any thoughts? Did I miss some important build steps, like special
defines or something, or maybe there are patches to current CVS trunk?

Best,

    --Yuri





  /*
   * We do a quick check to see if we need to do more work
   * to initialise a static mutex. We check
   * again inside the guarded section of ptw32_mutex_check_need_init()
   * to avoid race conditions.
   */
  if (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER)
0000000180006432  mov         rax,qword ptr [mutex]
000000018000643A  cmp         qword ptr [rax],0FFFFFFFFFFFFFFFDh
000000018000643E  jb          pthread_mutex_trylock+61h (180006461h)
    {
      if ((result = ptw32_mutex_check_need_init (mutex)) != 0)
0000000180006440  mov         rcx,qword ptr [mutex]
0000000180006448  call        @ILT+440(ptw32_mutex_check_need_init)
(1800011BDh)
000000018000644D  mov         dword ptr [result],eax
0000000180006451  cmp         dword ptr [result],0
0000000180006456  je          pthread_mutex_trylock+61h (180006461h)
	{
	  return (result);
0000000180006458  mov         eax,dword ptr [result]
000000018000645C  jmp         pthread_mutex_trylock+13Ch (18000653Ch)
	}
    }

  mx = *mutex;
0000000180006461  mov         rax,qword ptr [mutex]
0000000180006469  mov         rax,qword ptr [rax]
000000018000646C  mov         qword ptr [mx],rax

  if (0 == (LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE (
		     (PTW32_INTERLOCKED_LPLONG) &mx->lock_idx,
		     (PTW32_INTERLOCKED_LONG) 1,
		     (PTW32_INTERLOCKED_LONG) 0))
0000000180006471  xor         r8d,r8d
0000000180006474  mov         edx,1
0000000180006479  mov         rcx,qword ptr [mx]
000000018000647E  call        qword ptr
[ptw32_interlocked_compare_exchange (180016240h)]
0000000180006484  test        eax,eax
0000000180006486  jne         pthread_mutex_trylock+0CFh (1800064CFh)
    {
      if (mx->kind != PTHREAD_MUTEX_NORMAL)
0000000180006488  mov         rax,qword ptr [mx]
000000018000648D  cmp         dword ptr [rax+8],0
0000000180006491  je          pthread_mutex_trylock+0CDh (1800064CDh)
	{
	  mx->recursive_count = 1;

                 reply	other threads:[~2011-02-25 21:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikzCNuvbzZH2fMyqCG0LupL+ePYHqwrKm0Sy-nR@mail.gmail.com \
    --to=sadykov@gmail.com \
    --cc=pthreads-win32@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).