Re: [Python-ideas] New PyThread_tss_ C-API for CPython

2016-12-17 18:35 GMT+09:00 Stephen J. Turnbull <turnbull.stephen.fw@u. tsukuba.ac.jp>:
PyThread_create_key has required user to check the return value since when key creation fails, returns -1 instead of valid key value. Therefore, my patch changes PyThread_create_key that always return -1 on platforms that cannot cast key to int safely and current API never return valid key value to these platforms. Its advantage to not change function specifications and no effect on supported platforms. Hence, this is reason that doesn't raise any exception on the API. (2) of ideas can enable current API on specific-platforms. If it's simple, I'd have liked to select it. However, work that brings current API using native TLS to specific-platforms brings duplication implementation that manages keys, and it's ugly (same reason for Erik's draft, the last item of Rejected Ideas). Thus, I gave up to keep feature and decided to implement "no-op", delegate error handling to API users. Kind regards, Masayuki
participants (2)
-
Erik Bray
-
Masayuki YAMAMOTO