diff options
author | t00fcxen <t00fcxen@9df1edf5-d72c-5b5f-11c0-5f5209eb73f7> | 2013-11-30 11:01:47 +0000 |
---|---|---|
committer | t00fcxen <t00fcxen@9df1edf5-d72c-5b5f-11c0-5f5209eb73f7> | 2013-11-30 11:01:47 +0000 |
commit | 80cfbb09924c9417555e128a5d8cd76bb27ea135 (patch) | |
tree | 135546f3321de8a6c54c181903112e3e18bdeae7 | |
parent | cf25b08c148539eb2beed86aa77a654af3d6c753 (diff) | |
download | usrsctplib-80cfbb09924c9417555e128a5d8cd76bb27ea135.tar.gz |
Move initialization of global locks to the iterator
startup routine.
git-svn-id: http://sctp-refimpl.googlecode.com/svn/trunk/KERN/usrsctp/usrsctplib@8741 9df1edf5-d72c-5b5f-11c0-5f5209eb73f7
-rwxr-xr-x | netinet/sctp_bsd_addr.c | 3 | ||||
-rwxr-xr-x | netinet/sctp_pcb.c | 8 |
2 files changed, 3 insertions, 8 deletions
diff --git a/netinet/sctp_bsd_addr.c b/netinet/sctp_bsd_addr.c index 71e781b..1fd2497 100755 --- a/netinet/sctp_bsd_addr.c +++ b/netinet/sctp_bsd_addr.c @@ -178,6 +178,9 @@ sctp_startup_iterator(void) /* You only get one */ return; } + /* Initialize global locks here, thus only once. */ + SCTP_ITERATOR_LOCK_INIT(); + SCTP_IPI_ITERATOR_WQ_INIT(); TAILQ_INIT(&sctp_it_ctl.iteratorhead); #if defined(__FreeBSD__) #if __FreeBSD_version <= 701000 diff --git a/netinet/sctp_pcb.c b/netinet/sctp_pcb.c index 2b7feae..cbe27d8 100755 --- a/netinet/sctp_pcb.c +++ b/netinet/sctp_pcb.c @@ -6736,14 +6736,6 @@ sctp_pcb_init() for (i = 0; i < SCTP_STACK_VTAG_HASH_SIZE; i++) { LIST_INIT(&SCTP_BASE_INFO(vtag_timewait)[i]); } - /* - * Only initialize non-VNET global mutexes for the - * default instance. - */ - if (IS_DEFAULT_VNET(curvnet)) { - SCTP_ITERATOR_LOCK_INIT(); - SCTP_IPI_ITERATOR_WQ_INIT(); - } #if defined(SCTP_PROCESS_LEVEL_LOCKS) #if defined(__Userspace_os_Windows) InitializeConditionVariable(&sctp_it_ctl.iterator_wakeup); |