[ANNOUNCEMENT] python3 3.6.1-2 (x86 only)

Takashi Yano takashi.yano@nifty.ne.jp
Tue Mar 28 12:38:00 GMT 2017


On Sat, 25 Mar 2017 09:46:38 +0900 Takashi Yano wrote:
> from ctypes import pythonapi
> key = pythonapi.PyThread_create_key()
> res1 = pythonapi.PyThread_set_key_value(key, 5555)
> res2 = pythonapi.PyThread_get_key_value(key)
> res3 = pythonapi.PyThread_delete_key(key)
> print(key,res1,res2,res3)

There was one mistake. The function type of PyThread_delete_key() is
void, so the return value is meaningless (just a garbage).

Moreover, the script works as expected if modified as follows.

--- from here ---
from ctypes import *
pythonapi.PyThread_create_key.restype = c_long
pythonapi.PyThread_set_key_value.argtypes = [c_long, c_void_p]
pythonapi.PyThread_get_key_value.restype = c_void_p
pythonapi.PyThread_get_key_value.argtypes = [c_long]
key = pythonapi.PyThread_create_key()
res1 = pythonapi.PyThread_set_key_value(key, 5555)
res2 = pythonapi.PyThread_get_key_value(key)
print(key,res1,res2)
--- to here ---

This is because 3.6-thread-cygwin64.patch is changing the type of
functions as the key type is changed from int to long.

However, from the portability point of view, it is not desirable to
change the types of functions exported as APIs.

If one of the idea of the patches I proposed will be employed, the
patch 3.6-thread-cygwin64.patch is not necessary anymore.

Thus, I would like to propose new version of the patches replacing
3.6-thread-cygwin64.patch.

3.6-thread-cygwin-replacement-1.patch:
  replaces 3.6-thread-cygwin64.patch and pthread-cygwin-1.patch

3.6-thread-cygwin-replacement-2.patch:
  replaces 3.6-thread-cygwin64.patch and pthread-cygwin-2.patch

I would appreciate your comment.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.6-thread-cygwin-replacement-1.patch
Type: application/octet-stream
Size: 1906 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170328/94f26430/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3.6-thread-cygwin-replacement-2.patch
Type: application/octet-stream
Size: 1940 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20170328/94f26430/attachment-0001.obj>
-------------- next part --------------

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


More information about the Cygwin mailing list