swimming in the sea

What do you do with your backpack so that it doesn't change hands while swimming in the sea at a public (frequently visited) beach? I am traveling alone, edit: and sleeping im hammock.