[WiFi][Connection] Apply CAPIs for thread handling (#134)
[platform/core/csapi/tizenfx.git] / src / Tizen.Network.WiFi / Tizen.Network.WiFi / WiFiManager.cs
index 1f2dbc9..96d613c 100755 (executable)
@@ -25,9 +25,12 @@ namespace Tizen.Network.WiFi
     /// <summary>
     /// A class for managing the WiFiManager handle.
     /// </summary>
+    /// <since_tizen> 3 </since_tizen>
     [EditorBrowsable(EditorBrowsableState.Never)]
     public sealed class SafeWiFiManagerHandle : SafeHandle
     {
+        private int tid;
+
         internal SafeWiFiManagerHandle() : base(IntPtr.Zero, true)
         {
         }
@@ -36,6 +39,7 @@ namespace Tizen.Network.WiFi
         /// Checks the validity of the handle.
         /// </summary>
         /// <value>Represents the validity of the handle.</value>
+        /// <since_tizen> 3 </since_tizen>
         public override bool IsInvalid
         {
             get
@@ -44,16 +48,28 @@ namespace Tizen.Network.WiFi
             }
         }
 
+        /// <summary>
+        /// Release the handle
+        /// </summary>
         protected override bool ReleaseHandle()
         {
-            Interop.WiFi.Deinitialize(this.handle);
+            Interop.WiFi.Deinitialize(tid, this.handle);
             this.SetHandle(IntPtr.Zero);
             return true;
         }
+
+        internal int TID
+        {
+            set
+            {
+                tid = value;
+                Log.Info(Globals.LogTag, "New Handle for Thread " + tid);
+            }
+        }
     }
 
     /// <summary>
-    /// A manager class which allows applications to connect to a Wireless Local Area Network (WLAN) and transfer data over the network.<br>
+    /// A manager class which allows applications to connect to a Wireless Local Area Network (WLAN) and transfer data over the network.
     /// The Wi-Fi Manager enables your application to activate and deactivate a local Wi-Fi device, and to connect to a WLAN network in the infrastructure mode.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>