| 68 | There are some issues we identified: |
| 69 | - Race condition : write method was called on an already destroyed SSL. |
| 70 | - Race condition : write_mutex destroyed before the call to send. |
| 71 | |
| 72 | These issues can be resolved by using the group lock and moving the cleanup code (`destroy_ssl()` and `pj_lock_destroy()`) to the group lock destroy method handler. |
| 73 | |
| 74 | Note that we can't move the `close_sockets()` operation to the destroy handler, since we need the `pj_grp_lock_dec_ref()` be called from `pj_activesock_close()`. However, we cannot set the `ssock->asock` to NULL since it will raise `asock == NULL` assertion. |
| 75 | |