调用SetEvent后调用CloseHandle(Calling CloseHandle after calling SetEvent)
我有一个线程在我的应用程序中运行。 在线程内我正在等待一个自动重置事件退出。 我想确保在我使用它之后关闭事件的句柄。 我有两个选择。
- 调用
SetEvent
后立即调用事件的CloseHandle
- 在
WaitForSingleObject
行后面调用CloseHandle
请建议我哪一个是正确的方法。
I have a thread running in my application. Inside the thread I am waiting on an auto reset event to exit. I want to make sure that i close the handle of the event after i use it. Ihave two options.
- Calling
CloseHandle
of the event immediately after callingSetEvent
- Calling
CloseHandle
after the lineWaitForSingleObject
Please suggest me which one is the right approach.
原文:https://stackoverflow.com/questions/6452580
更新时间:2023-01-04 16:01
最满意答案
然后,您可以在状态定义中添加新参数,然后在
ui-sref
指令中传递该参数,以便创建href
url创建ui-sref="home({foo: 'Foo,mojtaba1', bar: 'barVal1', name: name})"
You could then add new parameter in your state definition & then pass that parameter in
ui-sref
directive, so that will take carehref
url creationui-sref="home({foo: 'Foo,mojtaba1', bar: 'barVal1', name: name})"
相关问答
更多-
您可以在ui-sref中传递数据 您可以使用问题中定义的$ stateParams在页面中访问它...祝你好运 You can pass data in ui-sref as And yo ...
-
如何使用ui-router为AngularJS提取查询参数?(How to extract query parameters with ui-router for AngularJS?)[2022-07-27]
除非您绑定到查询参数(请参阅文档),否则不会直接通过$state或$stateParams访问它们。 使用$location服务。 编辑:根据文档 ,如果要在$stateParams捕获查询参数,可以附加一个? 并将每个查询参数命名为& ,即url: "/foo?bar&baz" 。 Unless you're binding to the query parameters (see the documentation), you don't access them directly through $st ... -
是否可以在PHP重定向中将参数传递给ui-router?(Is it possible to pass parameters to ui-router within a PHP redirect?)[2019-11-24]
如果你在状态url中定义你的参数 url: '/registration/:valid' 那么你不需要在查询字符串中指定它只是传递它的值。 喜欢这个: header( 'Location: http://<...>/registration/true'); 否则从url中删除参数,只需在params对象中定义它。 .state('registration', { url: '/registration/', templateUrl: '../partials/register/regi ... -
AngularJS:使用ui-router在URL中传递输入参数(AngularJS : Pass input parameter in URL with ui-router)[2023-01-19]
然后,您可以在状态定义中添加新参数,然后在ui-sref指令中传递该参数,以便创建href url创建 ui-sref="home({foo: 'Foo,mojtaba1', bar: 'barVal1', name: name})" You could then add new parameter in your state definition & then pass that parameter in ui-sref directive, so that will take care href ur ... -
您的状态定义需要明确声明它需要参数。 使用uirouter进行此操作的方法不止一种。 最简单的方法是将其添加到您的URL定义中: url: '/login?user&pass', 您应始终保持警惕处理用户凭据。 这种方法似乎可能是一个糟糕的代码味道。 您能否在原始问题中谈谈您对此控制器和状态的计划是什么,我们可以确保您不会面临安全问题。 Your state definition needs to explicitly state that it expects parameters. There ar ...
-
要识别myParam是对象的状态,您需要在您的状态params选项中定义其默认值,方法是指定null或您想要的任何默认值。 码 .state('orderDetail', { templateUrl: 'modules/common/orders/partials/detail.html?referrer', controller: 'OrderDetailCtrl', url: '/detail/:myParam', resolve: { ...
-
.state('home.action', { url: '/action/:theValue', templateUrl: 'criteria.html' }) .state('home.action', { url: '/action/:theValue', templateUrl: 'criteria.html' }) value, theValue在控制器中可用,如$stateParams.theValue I've found the solution. ...
-
angularjs,ui-router访问状态url开头的参数(angularjs, ui-router access to parameter at the beginning in the state url)[2021-11-16]
我认为您应该在app run函数中使用$ locationChangeStart事件,您可以从数据库中获取应用程序名称(使用服务/提供程序)。 app.run(["$rootScope", "$location", "$window",function ($rootScope, $location, $window){ $rootScope.$on("$locationChangeStart", function (event, next, current) { ... -
如果您使用templateUrl函数,则可以获取itemId参数: .state('MyApp.itemEdit',{ url: '/items/:itemId', views: { 'editItems@':{ templateUrl: function(params){ return '/core/edit-item-tmpl?' + params.itemId; ...
-
您的路线应该包含带查询参数的网址。 .state('index.my_route', { url: '/index/my_route?my_param', .... }); 现在可以使用带有参数的$ state.go以相同的方式调用状态。 Your route should have url with query parameter. .state('index.my_route', { url: '/index/my_route?my_param', .... }); Now ...