提交 01672dc9 authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #369 in FS/freeswitch from ~MICHAELGG/freeswitch:minor_perf_tweaks to master

* commit 'c599f4f4':
  FS-7894: On Windows, use critical sections instead of mutexes. (Mutexes on Windows are cross-process, unlike lightweight Linux futexes.)
  FS-7894: Event header ARRAY:: data -- use strcmp to ensure data begins with ARRAY:: instead of substring search
......@@ -269,6 +269,11 @@ SWITCH_DECLARE(switch_status_t) switch_thread_rwlock_unlock(switch_thread_rwlock
SWITCH_DECLARE(switch_status_t) switch_mutex_init(switch_mutex_t ** lock, unsigned int flags, switch_memory_pool_t *pool)
{
#ifdef WIN32
/* Old version of APR misunderstands mutexes. On Windows, mutexes are cross-process.
APR has no reason to not use critical sections instead of mutexes. */
if (flags == SWITCH_MUTEX_NESTED) flags = SWITCH_MUTEX_DEFAULT;
#endif
return apr_thread_mutex_create(lock, flags, pool);
}
......
......@@ -1053,7 +1053,7 @@ static switch_status_t switch_event_base_add_header(switch_event_t *event, switc
switch_event_del_header(event, header_name);
}
if (strstr(data, "ARRAY::")) {
if (!strncmp(data, "ARRAY::", 7)) {
switch_event_add_array(event, header_name, data);
FREE(data);
goto end;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论