geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-3136) Replace all public API time values with std::chrono types
Date Tue, 07 Nov 2017 16:58:01 GMT

    [ https://issues.apache.org/jira/browse/GEODE-3136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16242376#comment-16242376
] 

ASF GitHub Bot commented on GEODE-3136:
---------------------------------------

dgkimura commented on a change in pull request #144: GEODE-3136: Convert time values to std::chrono::duration.
URL: https://github.com/apache/geode-native/pull/144#discussion_r149397780
 
 

 ##########
 File path: clicache/integration-test/ThinClientAppDomainFunctionExecutionTests.cs
 ##########
 @@ -52,43 +52,45 @@ public void AddResult(TResult result)
     }
     public ICollection<TResult> GetResult()
     {
-      return GetResult(50);
+      return GetResult(TimeSpan.FromSeconds(50));
     }
 
-    public ICollection<TResult> GetResult(UInt32 timeout)
+    public ICollection<TResult> GetResult(TimeSpan timeout)
     {
       m_getResultCount++;
-      if (m_resultReady == true)
-      {
-        return m_results;
-      }
-      else
-      {
-        for (int i = 0; i < timeout; i++)
-        {
-          Thread.Sleep(1000);
-          if (m_resultReady == true)
-          {
-            return m_results;
-          }
 
+      lock (this) {
+        if (!m_resultReady) {
+          if (timeout > TimeSpan.Zero) {
+            if (!Monitor.Wait(this, timeout)) {
 
 Review comment:
   This is so much nicer!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Replace all public API time values with std::chrono types
> ---------------------------------------------------------
>
>                 Key: GEODE-3136
>                 URL: https://issues.apache.org/jira/browse/GEODE-3136
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>            Reporter: Jacob S. Barrett
>            Assignee: Jacob S. Barrett
>
> Remove ambiguity of time values by using [{{std::chrono}}|http://en.cppreference.com/w/cpp/chrono]
types in the public API. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message