Skip to content

Commit

Permalink
* thread_win32.c (w32_error): should report the function.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
unak committed Dec 30, 2009
1 parent 8de8d8b commit 5bc85d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Thu Dec 31 02:35:57 2009 NAKAMURA Usaku <usa@ruby-lang.org>

* thread_win32.c (w32_error): should report the function.

Thu Dec 31 01:58:47 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>

* ext/extmk.rb: fix for extstatic.
Expand Down
14 changes: 7 additions & 7 deletions thread_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Init_native_thread(void)
}

static void
w32_error(void)
w32_error(const char *func)
{
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
Expand All @@ -74,22 +74,22 @@ w32_error(void)
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) & lpMsgBuf, 0, NULL);
rb_bug("%s", (char*)lpMsgBuf);
rb_bug("%s: %s", func, (char*)lpMsgBuf);
}

static void
w32_set_event(HANDLE handle)
{
if (SetEvent(handle) == 0) {
w32_error();
w32_error("w32_set_event");
}
}

static void
w32_reset_event(HANDLE handle)
{
if (ResetEvent(handle) == 0) {
w32_error();
w32_error("w32_reset_event");
}
}

Expand Down Expand Up @@ -156,15 +156,15 @@ static void
w32_close_handle(HANDLE handle)
{
if (CloseHandle(handle) == 0) {
w32_error();
w32_error("w32_close_handle");
}
}

static void
w32_resume_thread(HANDLE handle)
{
if (ResumeThread(handle) == -1) {
w32_error();
w32_error("w32_resume_thread");
}
}

Expand Down Expand Up @@ -318,7 +318,7 @@ native_mutex_initialize(rb_thread_lock_t *lock)
#if USE_WIN32_MUTEX
*lock = CreateMutex(NULL, FALSE, NULL);
if (*lock == NULL) {
w32_error();
w32_error("native_mutex_initialize");
}
/* thread_debug("initialize mutex: %p\n", *lock); */
#else
Expand Down

0 comments on commit 5bc85d6

Please sign in to comment.