Wlan: Init the thread resume wait event before setting suspend event

While suspending threads suspend complete event is set before
resume wait event is initialized.

In case resume is followed by suspend there might arise a condition
where resume wait event is set even before its initialization.
Thus after initializing the wait event thread will keep on waiting
on the event and thus get stuck.

To avoid this initialize the thread resume wait event before
setting the suspend event.

Change-Id: Iaffacd23f363f386fbaef4de066784cfd4d9e139
CRs-Fixed: 972287
diff --git a/CORE/VOSS/src/vos_sched.c b/CORE/VOSS/src/vos_sched.c
index a96dfd8..dcf316f 100644
--- a/CORE/VOSS/src/vos_sched.c
+++ b/CORE/VOSS/src/vos_sched.c
@@ -609,11 +609,9 @@
                              &pSchedContext->mcEventFlag))
       {
         spin_lock(&pSchedContext->McThreadLock);
-
+        INIT_COMPLETION(pSchedContext->ResumeMcEvent);
         /* Mc Thread Suspended */
         complete(&pHddCtx->mc_sus_event_var);
-
-        INIT_COMPLETION(pSchedContext->ResumeMcEvent);
         spin_unlock(&pSchedContext->McThreadLock);
 
         /* Wait foe Resume Indication */
@@ -1157,13 +1155,10 @@
                              &pSchedContext->txEventFlag))
       {
         spin_lock(&pSchedContext->TxThreadLock);
-
+        INIT_COMPLETION(pSchedContext->ResumeTxEvent);
         /* Tx Thread Suspended */
         complete(&pHddCtx->tx_sus_event_var);
-
-        INIT_COMPLETION(pSchedContext->ResumeTxEvent);
         spin_unlock(&pSchedContext->TxThreadLock);
-
         /* Wait foe Resume Indication */
         wait_for_completion_interruptible(&pSchedContext->ResumeTxEvent);
       }
@@ -1359,11 +1354,9 @@
                              &pSchedContext->rxEventFlag))
       {
         spin_lock(&pSchedContext->RxThreadLock);
-
+        INIT_COMPLETION(pSchedContext->ResumeRxEvent);
         /* Rx Thread Suspended */
         complete(&pHddCtx->rx_sus_event_var);
-
-        INIT_COMPLETION(pSchedContext->ResumeRxEvent);
         spin_unlock(&pSchedContext->RxThreadLock);
 
         /* Wait for Resume Indication */