---
name: "cancel_work_sync"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/cancel_work_sync"
---

# cancel\_work\_sync(9)

cancel a work and wait for it to finish

## NAME

cancel\_work\_sync - cancel a work and wait for it to finish

## SYNOPSIS

**bool cancel\_work\_sync(struct work\_struct \*** *work***);**

## ARGUMENTS

*work*

the work to cancel

## DESCRIPTION

Cancel *work* and wait for its execution to finish. This function can be used even if the work re-queues itself or migrates to another workqueue. On return from this function, *work* is guaranteed to be not pending or executing on any CPU.

cancel\_work\_sync(delayed\_work-\>work) must not be used for delayed\_work's. Use **cancel\_delayed\_work\_sync** instead.

The caller must ensure that the workqueue on which *work* was last queued can't be destroyed before this function returns.

## RETURN

**true** if *work* was pending, **false** otherwise.

## COPYRIGHT
