SecureTransport APIs, can a SSL session reads and writes at the same time?

I create a SSLContext with Secure Transport APIs. And there are two GCD queues,one is for SSLRead calling and the other is for SSLWrite calling. SSLRead and SSLWrite use the same SSLContext.

My program works well for a while ,but then crashes. Debug log show like:


HDXCast(39729,0x7000085e3000) malloc: *** error for object 0x10111e400: pointer being freed was not allocated

*** set a breakpoint in malloc_error_break to debug



This seems like SSLWrite and SSLRead can not called at the same time with the same SSLContext,these APIs are not thread safe. Am I right?